Skip to content
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 24 commits into from
Feb 2, 2022
Merged

Install ktlint linter and fix lint issues #3687

merged 24 commits into from
Feb 2, 2022

Conversation

FloEdelmann
Copy link
Member

@FloEdelmann FloEdelmann commented Jan 28, 2022

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.

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
@westnordost
Copy link
Member

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

@smichel17
Copy link
Member

smichel17 commented Feb 2, 2022 via email

@westnordost westnordost merged commit 05f9543 into streetcomplete:master Feb 2, 2022
@FloEdelmann
Copy link
Member Author

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?

@matkoniecz
Copy link
Member

https://github.com/streetcomplete/StreetComplete/blob/master/CONTRIBUTING.md#development ?

@FloEdelmann
Copy link
Member Author

Done in 88d71c4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants