Skip to content

Commit

Permalink
dynamically add rubocop to default tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni authored and ehelms committed May 12, 2022
1 parent 3bde88d commit 4a941c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vagrant/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ Rake::TestTask.new do |t|
t.verbose = true
end

default_tasks = %i[test]

begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new
# insert 0, because Ruby 2.0 doesn't know Array.prepend
default_tasks.insert(0, 'rubocop')
rescue LoadError
puts 'Rubocop not loaded'
end

task :default => %i[rubocop test]
task :default => default_tasks

0 comments on commit 4a941c0

Please sign in to comment.