-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install ktlint
linter and fix lint issues
#3687
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
so we can enable them one-by-one in the following commits
reported and fixed by `no-blank-line-before-rbrace` ktlint rule
reported and fixed by `no-consecutive-blank-lines` ktlint rule
reported and fixed by `final-newline` ktlint rule
reported and fixed by `colon-spacing` ktlint rule
reported and fixed by `comma-spacing` ktlint rule
reported and fixed by `curly-spacing` ktlint rule
reported and fixed by `keyword-spacing` ktlint rule
reported and fixed by `op-spacing` ktlint rule
reported and fixed by `comment-spacing` ktlint rule
reported and fixed by `parameter-list-wrapping` ktlint rule
reported and fixed by `string-template` ktlint rule
reported and partly fixed by * `import-ordering` ktlint rule * `no-wildcard-imports` ktlint rule * `no-unused-imports` ktlint rule partly manually fixed
reported by `filename` ktlint rule, manually fixed
This is a hell of a PR to go through, I think I'll rather review+merge it after releasing v40.0-beta1 which I wanted to do today |
This is a hell of a PR to go through
Does it make any sense to break it up into chunks? First merge the linter, then trickle in PRs enabling the rules at a pace that's reasonable to review.
|
westnordost
reviewed
Feb 2, 2022
app/src/main/java/de/westnordost/streetcomplete/quests/road_name/RoadNameAnswer.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/de/westnordost/streetcomplete/util/CrashReportExceptionHandler.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/de/westnordost/streetcomplete/view/AutoCorrectAbbreviationsEditText.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/de/westnordost/streetcomplete/view/CircularMaskFrameLayout.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/de/westnordost/streetcomplete/view/MaskSpeechbubbleCornersFrameLayout.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/de/westnordost/streetcomplete/view/SlidingRelativeLayout.kt
Outdated
Show resolved
Hide resolved
westnordost
approved these changes
Feb 2, 2022
Yay, thanks for merging! I now found a ktlint plugin for IntelliJ IDEA which shows lint issues inline in the code: https://plugins.jetbrains.com/plugin/15057-ktlint-unofficial- Is there some place/documentation where we can recommend installing it? |
This was referenced Feb 2, 2022
Done in 88d71c4. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #3649.
This PR installs the ktlint linter using the ktlint-check GitHub Action. It runs everytime commits are pushed to the master branch, and indicates its result with a ✔️ or ❌ next to the commit.
Only the rules accepted in #3649 (comment) are enabled. I fixed the lint issues reported by all these rules (in individual commits).
Additionally, I also fixed some lint issues reported by the rejected rules (in individual commits), but each change was reviewed if it would actually improve readability.
On top of that, I did some more manual lint changes (in individual commits) to improve consistency and readability.