Rakefile in selenium-connect-3.3.1 vs Rakefile in selenium-connect-3.4.0

- old
+ new

@@ -1,16 +1,23 @@ # Encoding: utf-8 require 'rspec/core/rake_task' +require 'rubocop/rake_task' +require 'flog_task' +require 'flay_task' +require 'reek/rake/task' task default: :build -task build: [:clean, :prepare, :rubocop, :unit, :integration] +task build: [:clean, :prepare, :quality, :unit, :integration] desc 'Runs standard build activities.' -task build_full: [:clean, :prepare, :rubocop, :unit, :integration, :system] +task build_full: [:clean, :prepare, :quality, :unit, :integration, :system] +desc 'Runs quality checks.' +task quality: [:rubocop, :reek, :flog_total, :flog_average, :flay] + desc 'Removes the build directory.' task :clean do FileUtils.rm_rf 'build' FileUtils.rm 'chromedriver.log' if File.exist? 'chromedriver.log' FileUtils.rm 'libpeerconnection.log' if File.exist? 'libpeerconnection.log' @@ -38,15 +45,36 @@ RSpec::Core::RakeTask.new(:system) do |t| t.pattern = FileList['spec/integration/**/*_spec.rb'] t.rspec_opts = get_rspec_flags('system', '--tag selenium') end -desc 'Runs code quality check' -task :rubocop do - sh 'rubocop' +Rubocop::RakeTask.new + +# TODO: lower the quality score and improve the code! +FlogTask.new :flog_total, 1250 do |t| + t.method = :total_score + t.verbose = true end -# TODO This could probably be more cleanly automated +# TODO: lower the quality score and improve the code! +FlogTask.new :flog_average, 10 do |t| + t.method = :average + t.verbose = true +end + +# TODO: lower the quality score and improve the code! +FlayTask.new :flay, 200 do |t| + t.verbose = true +end + +# TODO: fix all the smells and turn on failing on error +Reek::Rake::Task.new do |t| + t.fail_on_error = false + t.verbose = false + t.reek_opts = '--quiet' +end + +# TODO: This could probably be more cleanly automated desc 'Start a release (Requires Git Flow)' task :release_start, :version do |t, args| version = args['version'] # make sure we have the latest stuff