-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add rubocop lint rules #3735
Merged
Merged
Add rubocop lint rules #3735
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javierm
force-pushed
the
remove_unused_variables
branch
from
September 29, 2019 11:26
a32a7e8
to
17dd30b
Compare
javierm
force-pushed
the
rubocop_lint
branch
from
September 29, 2019 11:27
b7d0395
to
5531e3b
Compare
javierm
force-pushed
the
remove_unused_variables
branch
from
September 29, 2019 14:00
17dd30b
to
994b580
Compare
javierm
force-pushed
the
rubocop_lint
branch
from
September 29, 2019 14:00
5531e3b
to
b3d47d2
Compare
javierm
force-pushed
the
remove_unused_variables
branch
from
September 29, 2019 14:08
994b580
to
306e7d2
Compare
javierm
force-pushed
the
rubocop_lint
branch
from
September 29, 2019 14:09
b3d47d2
to
54e7ed6
Compare
javierm
force-pushed
the
remove_unused_variables
branch
from
September 29, 2019 15:06
306e7d2
to
33af62d
Compare
javierm
force-pushed
the
rubocop_lint
branch
from
September 29, 2019 15:07
54e7ed6
to
29c87f0
Compare
javierm
force-pushed
the
remove_unused_variables
branch
from
September 29, 2019 15:41
33af62d
to
06a61b0
Compare
javierm
force-pushed
the
rubocop_lint
branch
from
September 29, 2019 15:41
e30654e
to
78a8edf
Compare
javierm
force-pushed
the
remove_unused_variables
branch
from
September 29, 2019 22:44
06a61b0
to
d8ce75a
Compare
javierm
force-pushed
the
rubocop_lint
branch
2 times, most recently
from
September 29, 2019 22:50
e077d1b
to
9781876
Compare
javierm
changed the base branch from
remove_unused_variables
to
rspec_instance_variables
September 29, 2019 22:51
javierm
force-pushed
the
rubocop_lint
branch
from
September 29, 2019 22:53
9781876
to
f1bd779
Compare
javierm
force-pushed
the
rspec_instance_variables
branch
5 times, most recently
from
September 30, 2019 14:43
cec060e
to
4de4045
Compare
javierm
changed the base branch from
rspec_instance_variables
to
rubocop_fixes
September 30, 2019 14:53
javierm
force-pushed
the
rubocop_lint
branch
from
September 30, 2019 14:54
f1bd779
to
37b0a01
Compare
javierm
force-pushed
the
rubocop_fixes
branch
5 times, most recently
from
October 5, 2019 12:42
50290d9
to
545f161
Compare
Naming two variables the same way is confusing at the very least, and can lead to hard to debug errors. That's why the Ruby interpreter issues a warning when we do so.
This is a very subtle behaviour: `match /attachment/i` could represent a regular expression, but it could also represent a division like `match / attachment / i`. So we need to make an exception to the usual way we omit parenthesis in RSpec expectations.
We're using `yield` in the method body.
These methods were defined with `attr_reader` (or accessor in some cases) and then they were redefined.
There are more cases where we have unused block arguments, but I'm only changing the obvious ones.
smarques
pushed a commit
to venetochevogliamo/consul
that referenced
this pull request
Apr 29, 2020
Add rubocop lint rules
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
The Ruby interpreter issues warnings on code having patterns which could easily result in bugs. Rubocop has rules to detect all those warnings and some more.
Objectives
Notes
There's one Ruby warning I haven't fixed: the autoload trigger in
PollsController
. We'll have to investigate whether the issue loading classes is still present after upgrading to Rails 5.There are also several rubocop rules I haven't added; they either give false positives, or are a bit overkill.