Skip to content

Commit ac2a6fb

Browse files
authored
Rescue RuboCop rake tasks require error (#1431)
On Ruby's CI, RuboCop is not installed and not needed. So we should rescue the error to allow it to still run tests with Rake.
1 parent c33d173 commit ac2a6fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Rakefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ $:.unshift File.expand_path('lib', __dir__) # default template dir
55
require_relative 'lib/rdoc/task'
66
require 'bundler/gem_tasks'
77
require 'rake/testtask'
8-
require 'rubocop/rake_task'
8+
9+
begin
10+
require 'rubocop/rake_task'
11+
rescue LoadError
12+
puts "RuboCop is not installed"
13+
end
914

1015
task :test => [:normal_test, :rubygems_test]
1116

0 commit comments

Comments
 (0)