-
Notifications
You must be signed in to change notification settings - Fork 510
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
Support factory methods using generics (ktlint-ruleset-standard) #2350
Milestone
Comments
Thnx for reporting and examples. I will investigate. |
paul-dingemans
added a commit
that referenced
this issue
Nov 19, 2023
…method or class constructor without specifying type Closes #2350
9 tasks
I do see value in supporting this. I have added a kind of 'lame' implementation for this which allows exactly this example. So in this way an overload of a class constructor or another factory method can be made without having to specify the type explitcitly. |
paul-dingemans
added a commit
that referenced
this issue
Feb 13, 2024
Also, the `indent` rule should not change unexpected indentation characters inside a string template but leave this up to the `string-template-indent` rule. As a result the `indent` rule could be a bit simplified. Closes #2350
paul-dingemans
added a commit
that referenced
this issue
Feb 13, 2024
Also, the `indent` rule should not change unexpected indentation characters inside a string template but leave this up to the `string-template-indent` rule. As a result the `indent` rule could be a bit simplified. Closes #2350
8 tasks
paul-dingemans
added a commit
that referenced
this issue
Feb 14, 2024
Also, the `indent` rule should not change unexpected indentation characters inside a string template but leave this up to the `string-template-indent` rule. As a result the `indent` rule could be a bit simplified. Closes #2350
Reference from PR #2553 is to be ignored for this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
Expect this code to not error.
ASTNode.isFactoryMethod() needs to be improved.
it.name
is a method name, andit.typeReference?.text
includes generics, so there will be a mismatch.As a problem related to factory methods, even one-liners that use the expression body will result in an error. Since this is an avoidable problem and difficult to analyze, I don't think it's necessary to deal with it.
Observed Behavior
Steps to Reproduce
https://github.com/sya-ri/ktlint-function-naming-factory-method-bug
Your Environment
.editorconfig
settingsThe text was updated successfully, but these errors were encountered: