-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Code Formatter #785
Code Formatter #785
Conversation
@@ -47,3 +48,7 @@ allprojects { | |||
maven { url "https://jitpack.io" } | |||
} | |||
} | |||
|
|||
subprojects { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a note, for the section above, should that apply to all projects or just subprojects? I'm using subprojects below since the relative gradle path matters
I have looked into it. As far as I can say spotless or ktlint are more strict than necessary. Also tried to find a way to disable the wildcard rule as this one does not make any sense, and is a default from AS. (the latest version of ktlint actually disables that rule, but beside that it complains about space after "//" which should not really be a concern) I will check alternatives, as I think the check should be 100% happy, if the default AS formatter is applied |
There is also detekt, which seems to offer better configuration options Might be worth taking a look at if it can also disable verifications for comments |
@AllanWang 1 minute late :D #786 |
Thank you so much for this PR. I decided to go with a little bit less strict detekt configuration. |
Resolves #778
Adds the codestyle by ktlint along with spotless.
The continuation indent is back to 4 in ktlint, as they claim there isn't an official spec (pinterest/ktlint#410)
Main point is that this allows you to enforce a certain style so new PRs will not modify the formatting.
If you'd like to go through with this, there are probably ways to change certain settings so that it matches what you'd like. For instance, right now wildcard imports are also disabled.
There are
check
andapply
commands in spotless if you wish to test it out. You will need to format through AS to fix wildcard imports first though.