-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 cop that detects operations with constant results #11191
Comments
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Jul 29, 2024
Makes progress on rubocop#11191. Certain numeric operations have no impact, being: Adding or subtracting 0, multiplying or dividing by 1 or raising to the power of 1. These are probably mistakes or leftover from debugging, so flag and optionally remove them.
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Jul 29, 2024
Makes progress on rubocop#11191. Certain numeric operations have no impact, being: Adding or subtracting 0, multiplying or dividing by 1 or raising to the power of 1. These are probably mistakes or leftover from debugging, so flag and optionally remove them.
8 tasks
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Aug 27, 2024
Makes progress on rubocop#11191. Certain numeric operations have no impact, being: Adding or subtracting 0, multiplying or dividing by 1 or raising to the power of 1. These are probably mistakes or leftover from debugging, so flag and optionally remove them.
bbatsov
pushed a commit
that referenced
this issue
Aug 31, 2024
Makes progress on #11191. Certain numeric operations have no impact, being: Adding or subtracting 0, multiplying or dividing by 1 or raising to the power of 1. These are probably mistakes or leftover from debugging, so flag and optionally remove them.
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Sep 3, 2024
8 tasks
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Sep 3, 2024
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Sep 9, 2024
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Sep 17, 2024
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Nov 1, 2024
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Nov 7, 2024
Zopolis4
added a commit
to Zopolis4/rubocop
that referenced
this issue
Nov 7, 2024
bbatsov
pushed a commit
that referenced
this issue
Nov 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspired by https://hexdocs.pm/credo/Credo.Check.Warning.OperationWithConstantResult.html
It should check for the code like
This is almost always a mistake (or just left after debugging, probably) or just redundant code.
The text was updated successfully, but these errors were encountered: