Skip to content

Commit

Permalink
Run yarn linting as part of default rake task
Browse files Browse the repository at this point in the history
This also updates the Rakefile to be more consistent with the other ones
on GOV.UK apps, by clearing a default task if it exists and re-defining
default as all lint and test tasks.
  • Loading branch information
kevindew committed Jan 8, 2021
1 parent 54de016 commit 491c5c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,5 @@ require File.expand_path("config/application", __dir__)

Rails.application.load_tasks

unless Rails.env.production?
require "rubocop/rake_task"

RuboCop::RakeTask.new(:rubocop) do |t|
t.patterns = %w[app config test Gemfile]
end

task default: %i[spec rubocop]
end
Rake::Task[:default].clear if Rake::Task.task_defined?(:default)
task default: %i[lint test jasmine:ci]
5 changes: 5 additions & 0 deletions lib/tasks/lint.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
desc "Run all linters"
task lint: :environment do
sh "bundle exec rubocop"
sh "yarn run lint"
end

0 comments on commit 491c5c9

Please sign in to comment.