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

Update the versions of all linters #153

Merged
merged 1 commit into from
Feb 27, 2019
Merged

Conversation

santiagovidal
Copy link
Contributor

This PR updates the versions of the following linters:

  • rubocop
  • reek
  • rails_best_practices
  • brakeman

Of those updates, the major change is reek, which we are moving from version 4 to 5. There are some important changes to rubocop as well.

Changes to reek:

  • Important Version bumped from 4.7.2 to 5.3.1
  • New config file: .reek.yml
  • I added a few checks to the config file that were missing, but keeping the default settings.

Changes to rubocop:

  • Version bumped from 0.49.1 to 0.65.0
  • Enabled the Layout/ClassStructure (disabled by default).
  • Enabled Style/ReturnNil (disabled by default).
  • Disabled Style/ExpandPathArguments (enabled by default).
  • Important Enabled the Rails cops (disabled by default). Of all the Rails cops, the following cops are different from the default configuration:
    • Rails/FilePath is disabled
    • Rails/SaveBang is enabled

Copy link

@Alxzu Alxzu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Contributor

@letiesperon letiesperon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

Copy link
Member

@santib santib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Contributor

@gonzaM gonzaM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

max_allowed_nesting: 2
ignore_iterators: []
NilCheck:
enabled: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we can enable this one? We see a lot of nil checks 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense in theory, but the rule is just too aggressive. For example, in ActAsApiRequest it was complaining about this line: request_content_type&.match?(/json/)

Basically it will complain if we use safe navigation or try.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, yeah.. I really don't like the try, but I think the &. is not that bad and we should allow it. Thanks for the clarification.

.reek.yml Outdated
accept: []
UncommunicativeModuleName:
enabled: true
exclude: ['V1']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have this one as a regex? Something like, for example /V\d/? Not sure on how it's going to resolve the conflict with the reject list, tho.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 👍

@santiagovidal santiagovidal merged commit 806435d into master Feb 27, 2019
@santiagovidal santiagovidal deleted the enhancement/update_linters branch February 27, 2019 13:47
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 this pull request may close these issues.