-
Notifications
You must be signed in to change notification settings - Fork 185
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
No unit insertion as an addition of no auto tupling #352
Conversation
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'll take a better look from a computer, but it looks 👌 I'm thinking we can probably merge this into NoAutoTupling and just rename the whole thing NoArgumentListAdaptation or something along those lines. WDYT @olafurpg? |
Also many thanks @insdami for picking this up, it's a really nice addition to Scalafix! |
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 for this contribution @insdami ! I am hiking this weekend at Scala World so my responses may be slow :)
I agree with @gabro, can we merge this with NoAutoTupling? We can keep the test suite separate, however. We may want to consider renaming the rewrite to NoAdaptedArgs eventually, but that can be left for a future PR.
Otherwise this PR looks great!
ctx.addRight(t.tokens.init.last, "()") | ||
|
||
override def fix(ctx: RuleCtx): Patch = { | ||
val adaptations = index.messages.toIterator.collect { |
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.
This will iterate through all reported messages in the workspace/project on every source file, we should move it outside of the fix
method.
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.
Sure, I'll do the same in NoAutoTupling
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.
Looking 💯
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.
LGTM 👍 thank you!
This PR is for #214.
I'm not quite sure how to compose it with
NoAutoTupling
to run it usingNoAdaptedArgs
as you propose on the comments.Have a look at it and let me know, please :)