Skip to content

Commit 07a3741

Browse files
committed
Run rubocop as part of default rake task
I try to always run the default rake task locally before I push any changes to GitHub. I find it frustrating if I do that and there are no failures, but then I see rubocop failures in the CI build. I'd prefer to see them locally. Since it doesn't look as if `.circleci/config.yml` is using any rake tasks, this shouldn't affect the CI build.
1 parent 2b62da5 commit 07a3741

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/tasks/default.rake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
return if Rails.env.production?
4+
5+
Rake::Task[:default].clear_prerequisites
6+
task default: %i[rubocop spec]

lib/tasks/rubocop.rake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
return if Rails.env.production?
4+
5+
require 'rubocop/rake_task'
6+
RuboCop::RakeTask.new

0 commit comments

Comments
 (0)