Skip to content
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

New lint cop to check mistypes in += or -= #9223

Closed
fatkodima opened this issue Dec 13, 2020 · 2 comments · Fixed by #9226
Closed

New lint cop to check mistypes in += or -= #9223

fatkodima opened this issue Dec 13, 2020 · 2 comments · Fixed by #9226

Comments

@fatkodima
Copy link
Contributor

Inspired by https://rules.sonarsource.com/ruby/type/Bug/RSPEC-2757 and https://www.viva64.com/en/w/v588/

I think many people did mistakes like the following

x =+ 2
@Drenmi
Copy link
Collaborator

Drenmi commented Dec 14, 2020

I guess the case of x =- 2 is more likely to have false positives, because it could be x = -2, but the space went in the wrong place. 🙂 Either way, I think this is a solid candidate for a Lint cop.

@bbatsov
Copy link
Collaborator

bbatsov commented Dec 14, 2020

I also think such a cop is a good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants