-
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
Apply rubocop basic rules #3764
Merged
Merged
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
9ae15d4
to
17ae9c9
Compare
2ecb52b
to
4d2ced6
Compare
We've got a rubocop rule preventing us from using them, and the tests are easier to read this way.
I was using Time.now because that's what Rails actually does, but we get a warning by rubocop.
We were a bit inconsistent when aligning equal signs vertically.
The `find` method raises an exception if nothing is found, so there's no need to check if it found something.
We were already using it most of the time, but not always.
Usually when we use `try` we actually mean `try!`, which is the same as the safe navigation operator. However, there are a few cases where we actually mean to execute a method if the object responds to that method. In those cases using `try` would actually be OK, but in order to avoid confusion as to whether we mean to check for `respond_to?` or we mean to use safe navigation, I'm removing all usages of `try`.
4d2ced6
to
38b7307
Compare
houndci-bot
reviewed
Oct 22, 2019
@@ -930,7 +930,7 @@ def investments_order | |||
scenario "Edit", :js do | |||
daniel = create(:user, :level_two) | |||
|
|||
create(:budget_investment, heading: heading,title: "Get Schwifty", author: daniel, created_at: 1.day.ago) | |||
create(:budget_investment, heading: heading, title: "Get Schwifty", author: daniel, created_at: 1.day.ago) |
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. [112/110] (https://rubystyle.guide#80-character-limits)
smarques
pushed a commit
to venetochevogliamo/consul
that referenced
this pull request
Apr 29, 2020
Apply rubocop basic 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.
Objectives
rubocop --config .rubocop_basic.yml --fail-level convention --display-only-fail-level-offenses
Notes
.rubocop.yml
contains rules we haven't agreed upon (yet). We don't follow some of the rules defined there, and this pull request doesn't adress those rules.Severity: refactor
(that is,Metrics/LineLength
) is not addressed in this pull request either. We might address it in the future.