-
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
Change basic rubocop rules #3636
Conversation
@@ -56,7 +56,7 @@ def census_api_response | |||
def fill_stats_fields | |||
if in_census? | |||
self.gender = census_api_response.gender | |||
self.geozone_id = Geozone.select(:id).where(census_code: census_api_response.district_code).first.try(:id) | |||
self.geozone_id = Geozone.select(:id).where(census_code: census_api_response.district_code).first&.id |
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.
Metrics/LineLength: Line is too long. [111/110] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
@@ -25,7 +25,7 @@ def show | |||
.where.not(description: "").order(:given_order) | |||
|
|||
@answers_by_question_id = {} | |||
poll_answers = ::Poll::Answer.by_question(@poll.question_ids).by_author(current_user.try(:id)) | |||
poll_answers = ::Poll::Answer.by_question(@poll.question_ids).by_author(current_user&.id) |
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.
Lint/UselessAssignment: Useless assignment to variable - poll_answers. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
@@ -18,7 +18,7 @@ | |||
scenario "The username links to their public profile" do | |||
click_link @user.name | |||
|
|||
expect(current_path).to eq(user_path(@user)) | |||
expect(page).to have_current_path(user_path(@user)) |
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.
RSpec/InstanceVariable: Use let instead of an instance variable. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable)
be81033
to
60949bb
Compare
caa769b
to
92d44c4
Compare
4a68574
to
654b974
Compare
0a1e7ef
to
577d85d
Compare
d519471
to
b6fd326
Compare
577d85d
to
423646b
Compare
b6fd326
to
b11c5aa
Compare
423646b
to
c6faf08
Compare
b11c5aa
to
f72301a
Compare
c6faf08
to
008b9c7
Compare
f72301a
to
2406de8
Compare
008b9c7
to
b09d920
Compare
2406de8
to
39ba010
Compare
987099c
to
d0bd2b8
Compare
39ba010
to
476d7d2
Compare
d0bd2b8
to
f0bb01b
Compare
476d7d2
to
8bb6fbf
Compare
c13e709
to
f9ed186
Compare
8bb6fbf
to
c04ea2c
Compare
We use staging and preproduction environments, which are not valid by default. This rule is useful because misspelling the name of an environment might otherwise go unnoticed.
We're not using the InsecureProtocolSource rule because I don't feel it's necessary.
These are rules we were already applying. We've excluded the `factories` folder for some rules because there's a factory defining a `context` attribute, which rubocop thought was the `context` RSpec keyword.
c04ea2c
to
2243809
Compare
Travis failure is not related to this pull request. |
…cop_rules Change basic rubocop rules
References
Objectives