lib/rubocop/stylecheck/tasks/rubocop.rake in rubocop-stylecheck-0.1.1 vs lib/rubocop/stylecheck/tasks/rubocop.rake in rubocop-stylecheck-0.1.2

- old
+ new

@@ -1,34 +1,33 @@ require "rubocop/stylecheck" require "fileutils" -def run(options) - sh "bundle exec rubocop #{options.join(' ')}" do |ok, _res| - abort "Fix code style errors" unless ok - end -end - namespace :style do namespace :rubocop do desc "Run RuboCop with auto_correct" task :with_auto_correct do - run(Rubocop::Stylecheck::Cli.options_with_auto_correct) + Rubocop::Stylecheck::Cli.run( + Rubocop::Stylecheck::Cli.options_with_auto_correct + ) end desc "Run RuboCop without auto_correct" task :without_auto_correct do - run(Rubocop::Stylecheck::Cli.options_with_cop) + Rubocop::Stylecheck::Cli.run( + Rubocop::Stylecheck::Cli.options_with_cop + ) end desc "Generate local RuboCop config" task :generate_local_config do template_config_path = Rubocop::Stylecheck.config_path project_config_path = Rubocop::Stylecheck.project_config_path if template_config_path && File.exist?(template_config_path) FileUtils.cp(template_config_path, project_config_path) else - abort "Config file doesn't exist, please use Robocop::Stylecheck.config_path = ..." + abort "Config file doesn't exist, please use" \ + "Robocop::Stylecheck.config_path = ..." end end end end