Focus-android: Update to latest version of ktlint

Created on 20 Apr 2018  路  6Comments  路  Source: mozilla-mobile/focus-android

We are using ktlint 0.14.0. The latest version is 0.21.0.

Before we can switch we need to fix the issues that the new version has found in our code base.

P5 code good first issue help wanted

All 6 comments

Hi Guys, I want to resolve this issue. I am new to contributing, so can anyone help me get the necessary information to understand this issue. Thanks :)

@pocmo I just changed the ktlint version and ran a build. I did not run into any build errors. What are the issues with the code base that you are talking about?
My created branch with the latest commit can be found here.
Build details can be found here.

Hi, I would like to contribute to this issue. Since I'm new, @pocmo can you please guide me a bit?
Thank you.

In order to fix this issue you'll have to change the ktlint version to 0.21.0 here:
https://github.com/mozilla-mobile/focus-android/blob/03a35737223d42219d95ceabde59d929c674b123/build.gradle#L69

After that run:

./gradlew ktlint

This should print a list of issues that needs to be fixed:

[...]
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/settings/ManualAddSearchEngineSettingsFragment.kt:176:21: Unexpected indentation (expected 12, actual 20)
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/settings/ManualAddSearchEngineSettingsFragment.kt:176:53: Parameter should be on a separate line (unless all parameters can fit a single line)
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/settings/ManualAddSearchEngineSettingsFragment.kt:176:78: Missing newline before ")"
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/widget/AnimatedProgressBar.kt:40:17: Parameter should be on a separate line (unless all parameters can fit a single line)
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/widget/AnimatedProgressBar.kt:41:17: Unexpected indentation (expected 8, actual 16)
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/widget/AnimatedProgressBar.kt:41:37: Missing newline before ")"
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/widget/AnimatedProgressBar.kt:45:17: Parameter should be on a separate line (unless all parameters can fit a single line)
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/widget/AnimatedProgressBar.kt:46:17: Unexpected indentation (expected 8, actual 16)
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/widget/AnimatedProgressBar.kt:47:17: Unexpected indentation (expected 8, actual 16)
/Users/skaspari/Projects/Mozilla/Focus/app/src/main/java/org/mozilla/focus/widget/AnimatedProgressBar.kt:47:34: Missing newline before ")"
[..]

Okay, thank you.

@pocmo Is there any issue on which I can work?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maykonchagas picture maykonchagas  路  7Comments

Benestar picture Benestar  路  7Comments

st3fan picture st3fan  路  5Comments

zekooooo picture zekooooo  路  7Comments

runboy93 picture runboy93  路  5Comments