From 7d9f9a2688b0c9de320125d8b09197084b43ed5a Mon Sep 17 00:00:00 2001 From: Bruce Bolt Date: Tue, 1 Feb 2022 10:40:46 +0000 Subject: [PATCH] Add rubocop to the default rake task This will require the lint to run as part of the default build. --- Rakefile | 4 ++-- lib/tasks/lint.rake | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 lib/tasks/lint.rake diff --git a/Rakefile b/Rakefile index 682f8a3..faf8e16 100644 --- a/Rakefile +++ b/Rakefile @@ -32,6 +32,6 @@ namespace :dummy_app do end # Load local tasks -Dir["tasks/**/*.rake"].each { |file| load file } +Rails.application.load_tasks -task default: [:spec, "dummy_app:jasmine:ci", "sass:check"] +task default: ["lint", :spec, "dummy_app:jasmine:ci", "sass:check"] diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake new file mode 100644 index 0000000..954dda5 --- /dev/null +++ b/lib/tasks/lint.rake @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +desc "Lint files" +task "lint" => :environment do + sh "rubocop --format clang" +end