Sha256: 71423c5fec11d8b4759fed50aef6c542aa3cbc744e12b8c1eca66a166013e9c9
Contents?: true
Size: 1.15 KB
Versions: 10
Compression:
Stored size: 1.15 KB
Contents
namespace :check do namespace :rubocop do metric = Hexx::Suit::Metrics::Rubocop caller = Hexx::RSpec::System format = -> { ENV.fetch("RUBOCOP_FORMAT") { "html" } } output = -> { ENV.fetch("RUBOCOP_OUTPUT") { "tmp/rubocop/index.html" } } options = lambda do "-f #{ format.call } -o #{ output.call } -c config/metrics/rubocop.yml" end # Loads settings for rubocop metric from the '.hexx-suit.yml' task :configure do metric.load end desc "Runs rubocop metric" task run: :configure do puts "******* STARTING METRIC rubocop" caller.call "rubocop #{ options.call }" puts "see results in #{ output.call }" puts "******* ENDING METRIC rubocop" end desc "Displays the results of rubocop last run" task display: :configure do if format.call == "html" caller.call "launchy #{ output.call }" else puts "******* DISPLAYING METRIC rubocop" caller.call "cat #{ output.call }" puts "******* ENDING METRIC rubocop" end end end desc "Runs rubocop metric and displays the results" task rubocop: %w(rubocop:run rubocop:display) end
Version data entries
10 entries across 10 versions & 1 rubygems