-
Notifications
You must be signed in to change notification settings - Fork 507
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
v1.3.0 class-signature error for android_studio config #2713
Comments
Can you confirm that you upgraded from a The
I have no clue how this ended up in the documentation as it violates the idea behind the rule that class signature are formatted consistently. The signature above are comparable, and as of that have to be formatted in the same way. I will update the documentation so that it is consistent with the code. Btw you can force the multiline code style of class |
No, our current ktlint version is 1.2.1. We do have a bit of a mix of class signatures in our 5 year old code base, but until now ktlint never complained. |
Please provide concrete examples and their respective I have no recollection of changing anything in the |
For this class, I get no errors with 1.2.1. With 1.3.0 I get the following: SecureStringPreference.kt:19:5: No whitespace expected between opening parenthesis and first parameter name (standard:class-signature) .editorconfig is the same in both cases:
|
As documented in https://github.com/pinterest/ktlint/releases/tag/1.3.0 the You can force the multiline code style of class Foo3 by setting following in
I noted that your Also, I see |
Alright, that makes sense, thank you. I'll add the root = true. We have a naming convention to start our instrumentation tests with an uppercase letter + number code (e.g. E0123) to make it easier to identify them across platforms and tester documentation. It didn't really seem worth renaming them all when the ktlint rule was added. |
I see. It is an inventive usage for |
Expected Behavior
According to https://pinterest.github.io/ktlint/latest/rules/standard/#class-signature, both
should be accepted when ktlint_code_style is set to android_studio
Observed Behavior
My code style is set to android_studio. After updating to v1.3.0, all cases where we use formatting like the Foo3 example (parameters not on one line even though they would fit) are considered errors.
Steps to Reproduce
Copy
to a project with code style android_studio and run ktlint.
The text was updated successfully, but these errors were encountered: