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

Add reference to rubocop-rails so we can use the Rails cops #10

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

bunnymatic
Copy link
Contributor

Problem

We had specified some Rails cop rules at the bottom of rubocop.yml but we
did not include the rubocop-rails rules at the top so rubocop was complaining:

Error: unrecognized cop Rails/ApplicationRecord found in .rubocop.yml, unrecognized cop Rails/HasAndBelongsToMany found in .rubocop.yml, unrecognized cop Rails/RakeEnvironment found in .rubocop.yml

Solution

Add to the require line rubocop-rails so those cops will be defined before we read the rubocop.yml file.

Note: this means projects that include this file may need to add rubocop-rails to their Gemfiles

Problem
-----------

We had specified some Rails cop rules at the bottom of `rubocop.yml` but we
did not include the `rubocop-rails` rules at the top so `rubocop` was complaining:

```
Error: unrecognized cop Rails/ApplicationRecord found in .rubocop.yml, unrecognized cop Rails/HasAndBelongsToMany found in .rubocop.yml, unrecognized cop Rails/RakeEnvironment found in .rubocop.yml
```

Solution
-----------
Add to the `require` line `rubocop-rails` so those cops will be defined before we read the rubocop.yml file.

Note:  this means projects that include this file *may* need to add `rubocop-rails` to their Gemfiles
Copy link
Contributor

@mattbrictson mattbrictson left a comment

Choose a reason for hiding this comment

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

I agree; we either add the rubocop-rails requirement or we remove all of the Rails/* cop configs. This seems like the best option.

@bunnymatic
Copy link
Contributor Author

Based on a discussion today - it seems that the way raygun works, it will point to this remote file so as soon as this is merged, we may cause issues down the line (to apps that point to this file remotely).

Should we still merge? @christiannelson, thoughts?

I guess we have no easy way of notifying all the consumers, right?

@bunnymatic bunnymatic merged commit 9d2225e into master Jan 29, 2020
@bunnymatic bunnymatic deleted the chores/include-rspec-rails-for-rails-cops branch January 29, 2020 18:38
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.

2 participants