-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Run RuboCop over its self for the default rake task #571
Conversation
@@ -23,7 +23,15 @@ task :coverage do | |||
Rake::Task['spec'].execute | |||
end | |||
|
|||
task default: :spec | |||
desc 'Run RuboCop over its self' | |||
task :inception do |
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.
Already there's Rubocop::RakeTask
.
https://github.com/bbatsov/rubocop/blob/503478cf9c07affaebd4c66d04dd4fd7b0449314/README.md#rake-integration
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.
Oh, perfect! I'll switch it over to that
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, maybe not.
It adds a fair bit of load time to the rake file (quarter of a second on my MBP). How perf-sensitive should I be here, @bbatsov? (Though, I suppose the better approach is to optimize the load time of rubocop/rake_task
in general, if it's a concern)
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.
Actually, just committed best of both worlds
Run RuboCop over its self for the default rake task
@nevir Nice solution! |
@@ -23,7 +24,10 @@ task :coverage do | |||
Rake::Task['spec'].execute | |||
end | |||
|
|||
task default: :spec | |||
desc 'Run RuboCop over its self' |
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.
"its self"? Not "itself"?
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.
Doh!
I think this'll help a lot for contributors (the current breakage on master, and I ran into it on my other pull requests too) - force us to check style by default :)