-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Register new offenses for #294
Register new offenses for #294
Conversation
# end | ||
# end | ||
# | ||
# # good (Rails >= 6.1) |
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.
Rails 6.1 has not been released yet. Can you provide a URL of rails/rails repo's PR that includes this feature?
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.
Yeah just found it by chance in this comment.
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.
@koic Did you just want to see the PR or did you want me to actually add to the comment in code here?
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.
@koic updated.
1dc1191
to
a73cd5a
Compare
a157b3f
to
3b3b4f5
Compare
I added Can you rebase with the latest master branch and add spec for Rails 6.0 and Rails 6.1 context behaviours? |
304f073
to
fa62b32
Compare
@koic done! |
CHANGELOG.md
Outdated
@@ -48,6 +48,7 @@ | |||
* [#263](https://github.com/rubocop-hq/rubocop-rails/pull/263): Change terminology to `ForbiddenMethods` and `AllowedMethods`. ([@jcoyne][]) | |||
* [#289](https://github.com/rubocop-hq/rubocop-rails/pull/289): Update `Rails/SkipsModelValidations` to register an offense for `insert_all`, `touch_all`, `upsert_all`, etc. ([@eugeneius][]) | |||
* [#293](https://github.com/rubocop-hq/rubocop-rails/pull/293): Require RuboCop 0.87 or higher. ([@koic][]) | |||
* [#294](https://github.com/rubocop-hq/rubocop-rails/pull/294): Update `Rails/ReversibleMigration` to register offenses for `remove_columns` and `remove_index`. ([@philcoggins][]) |
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.
Can you rebase with the latest master branch and move this entry to under the ### Changes
of ## master (unreleased)
section?
|
||
dir.down do | ||
add_column :users, :name, :string | ||
add_column :users, :name, :email |
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.
Is this a typo?
add_column :users, :name, :email | |
add_column :users, :email, :string |
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.
Updated, but I can't regenerate docs now:
bundle exec rake default
rake aborted!
LoadError: cannot load such file -- rubocop/cops_documentation_generator
tasks/cops_documentation.rake:6:in `require'
tasks/cops_documentation.rake:6:in `<top (required)>'
/Users/philcoggins/Workbench/rubocop-rails/Rakefile:6:in `load'
/Users/philcoggins/Workbench/rubocop-rails/Rakefile:6:in `block in <top (required)>'
/Users/philcoggins/Workbench/rubocop-rails/Rakefile:6:in `each'
/Users/philcoggins/Workbench/rubocop-rails/Rakefile:6:in `<top (required)>'
/Users/philcoggins/.rbenv/versions/2.6.6/bin/bundle:23:in `load'
/Users/philcoggins/.rbenv/versions/2.6.6/bin/bundle:23:in `<main>'
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.
Updated, but I can't regenerate docs now:
Can you try running bundle update
?
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.
Anyway, the doc has been updated. I'm going to merge this PR. Thank you for your contribution!
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.
Ah, I overlooked that the document generation hasn't finished yet 💦 I committed below:
d8f0f0b
fa62b32
to
1cfeea9
Compare
Adds missing offenses for
remove_columns
andremove_index
methods.This is my first Rubocop contribution, so please review carefully!
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.