-
Notifications
You must be signed in to change notification settings - Fork 83
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
Update KTLint #585
Update KTLint #585
Conversation
@mickael-menu @qnga This is ready for review. Simply comment out the rule in Some of the rules seemed to either get more strict or were fixed, like no semicolons now applying to enum classes. |
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.
Looks good to me. We might be able to re-enable some rules after removing some deprecated code.
This is ready for review again. The auto-format was run and committed for individual rules, so those can be reverted easily if needed. The only one I'm not sure about that I did run was wrapping. If you don't like those changes, I'll revert that commit. Otherwise, I think everything else looks good. Note that I left trailing-comma-on-call-site and trailing-comma-on-declaration-site in there as it changes 357 files and 162 files respectively. |
Indeed, I would go without the wrapping rule. Constructors look cumbersome with it. @mickael-menu? |
Looking at it again, maybe it's not horrible. Generic type and type parameter each has its own line. Old public interface TtsEngine<S : TtsEngine.Settings, P : TtsEngine.Preferences<P>,
E : TtsEngine.Error, V : TtsEngine.Voice> : Configurable<S, P>, Closeable { New public interface TtsEngine<
S : TtsEngine.Settings,
P : TtsEngine.Preferences<P>,
E : TtsEngine.Error,
V : TtsEngine.Voice
> : Configurable<S, P>, Closeable { |
I think that looks fine but more importantly I prefer sticking to default options unless they are really asinine. |
ktlint_standard_no-wildcard-imports = disabled | ||
ktlint_standard_max-line-length = disabled | ||
|
||
ktlint_standard_class-naming = disabled |
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.
Did the -naming
rules required a breaking update?
.editorconfig
Outdated
ktlint_standard_trailing-comma-on-call-site = disabled | ||
ktlint_standard_trailing-comma-on-declaration-site = disabled |
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.
These two triggered too many changes?
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.
I didn't want to make that change without some input. From the Kotlin coding conventions:
The Kotlin style guide encourages the use of trailing commas at the declaration site and leaves it at your discretion for the call site.
I'll have it auto-format declaration. If the same is wanted for call, I can run that too.
That's by no means following a different standard, just keeping a bit more freedom. I don't care much though. |
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.
Thank you @stevenzeck, I think we can get started with these rules.
This PR updates the ktlint gradle plugin to the latest version. In doing so, we are also updating ktlint itself to 1.0.0, and there seems to be a lot of changes there.
Note that
ktlint_code_style
is set tointellij_idea
. That was the default style before 1.0 so it should match our current. There is an option forandroid_studio
too.