-
-
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
Run ktlint
on any push
#3760
Run ktlint
on any push
#3760
Conversation
At the moment it is easy to make some changes and only get feedback that there are linting issues after that change reaching master. By running ktlint on any push contributors will get feedback sooner. This should hopefully result in fewer linting issues reaching master.
I'd really not like ktlint to build a regime here. I.e. consistent code formatting is nice but if it becomes a (perceived) barrier in contributing, then it must go. Because really, whether it's Thus, that ktlint does not nitpick so often / so early is deliberate. Incidentally I activated the ktlint plugin for Android Studio as it is now recommended in a readme somewhere but my experience so far has been that ktlint is a bit annoying. So I am thinking about deactivating it again.
|
Hehe and this tool calls itself "anti-bikeshedding" well… 😅 On the other hand, it also has a built-in formatter (accoridng to that doc, I don't know the tool), so could not we instead of showing all errors on push, just automatically commit and fix and push them? GitHub actions can commit and push without problems.... |
No, I initially had it like that ( |
I agree with that. "Lint on save" instead of "Lint while typing" would help here. I suggested that in a similar issue on the plugin's bug tracker: nbadal/ktlint-intellij-plugin#125 (comment)
You can configure that: |
Yeah that could work. @westnordost would that be okay for you? |
Thanks for the hint to the configurations! Is there any possibility to add this as default per .editorconfig or similar?
No. A human must have the final say over how things are formatted, ktlint may only advise. |
Anyway, I'll close this PR. |
Yes, I've added the config file to Git in 970eff3. |
Perfect, thanks! |
@adrianclay (or anyone reading this): By the way, installing the Ktlint (unofficial) Android Studio plugin like described in the contributing guide will probably solve the issue for your future contributions, as you will notice lint issues right away. |
At the moment it is easy to make some changes and only get feedback that there are linting issues after that change reaching master.
By running ktlint on any push contributors will get feedback sooner. This should hopefully result in fewer linting issues reaching master.