-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added remove_index #1
Conversation
module Cop | ||
module Migrations | ||
# Your code goes here... | ||
# Removing indexes is dangerous by nature, if the index you remove | ||
# is used extensively, you could end up with database degradation. |
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.
That sounds to me
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.
hehe
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.
or simply downtime
end | ||
|
||
end | ||
end |
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.
What about testing when rubocop:disable Migrations/RemoveIndex
comment is there?
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.
That is part of rubocop code. I have testes it manually and it works, but that functionality is not related with a cop itself, but is about rubocop.
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.
got it
👍 |
@@ -1,2 +1,3 @@ | |||
--format documentation | |||
--color | |||
--require spec_helper |
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.
putting this here has bitten me tons of times, but probably someone else told you that it is awesome
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.
we don't use it on hosted and I'm not sure it's very common...
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.
I dropped it but does not show up... wonder why
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.
Fixed
📭 👍 |
59060e5
to
b7e288c
Compare
module Cop | ||
module Migrations | ||
# Your code goes here... | ||
# Removing indexes is dangerous by nature, if the index you remove | ||
# is used extensively, you could end up with database degradation. |
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.
or simply downtime
class RemoveIndex < Cop | ||
MSG = 'remove_index is disalowed'.freeze |
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.
s/disalowed/disallowed
spec.description = "" | ||
spec.homepage = "" | ||
spec.license = "MIT" | ||
spec.authors = %w(enricostano magec) |
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.
add your name as well
spec.add_development_dependency "bundler", "~> 1.11" | ||
spec.add_development_dependency "rake", "~> 10.0" | ||
spec.add_development_dependency "rspec", "3.5.0" | ||
spec.add_development_dependency 'bundler', '~> 1.11' |
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.
I believe the latest is 1.13 something. I would relax it more to be able to use the latest.
@@ -1,2 +1,3 @@ | |||
--format documentation | |||
--color | |||
--require spec_helper |
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.
we don't use it on hosted and I'm not sure it's very common...
👏 👍 |
WAT
Adds a check to disallow remove_index
GIF