From 8babbe32ce336b41f86f62bd88d91603acdafcb4 Mon Sep 17 00:00:00 2001 From: Ryan McKern Date: Wed, 1 Mar 2017 11:51:21 -0800 Subject: [PATCH] Add Rubocop support to Rakefile --- Rakefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 755ebc1..efbd5a9 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,7 @@ require 'rubygems' require 'bundler/setup' require 'rspec/core/rake_task' +require 'rubocop/rake_task' # Immediately sync all stdout so that tools like buildbot can # immediately load in the output. @@ -8,7 +9,7 @@ $stdout.sync = true $stderr.sync = true # Change to the directory of this file. -Dir.chdir(File.expand_path("../", __FILE__)) +Dir.chdir(File.expand_path('../', __FILE__)) # This installs the tasks that help with gem creation and # publishing. @@ -16,7 +17,13 @@ Bundler::GemHelper.install_tasks # Install the `spec` task so that we can run tests. RSpec::Core::RakeTask.new(:spec) do |t| - t.rspec_opts = "--order defined" + t.rspec_opts = '--order defined' end + +desc 'Run RuboCop' +RuboCop::RakeTask.new(:rubocop) do |task| + task.options << '--display-cop-names' +end + # Default task is to run the unit tests -task :default => :spec +task default: :spec