Sha256: d159e33d4d7c8daf413194aa4f111da531b10d423b5142a6e9ec464ac3c45fb9

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

begin
  require 'rubocop/rake_task'

  test_patterns = [
    "#{ForemanSccManager::Engine.root}/*.gemspec",
    "#{ForemanSccManager::Engine.root}/*.rb",
    "#{ForemanSccManager::Engine.root}/app/**/*.rb",
    "#{ForemanSccManager::Engine.root}/config/**/*.rb",
    "#{ForemanSccManager::Engine.root}/db/**/*.rb",
    "#{ForemanSccManager::Engine.root}/lib/**/*.rake",
    "#{ForemanSccManager::Engine.root}/lib/**/*.rb",
    "#{ForemanSccManager::Engine.root}/test/**/*.rb",
  ]

  namespace :foreman_scc_manager do
    desc 'Runs Rubocop style checker'
    RuboCop::RakeTask.new(:rubocop) do |task|
      task.patterns = test_patterns
    end

    desc 'Runs Rubocop style checker with xml output for Jenkins'
    RuboCop::RakeTask.new('rubocop:jenkins') do |task|
      task.patterns = test_patterns
      task.requires = ['rubocop/formatter/checkstyle_formatter']
      task.formatters = ['RuboCop::Formatter::CheckstyleFormatter']
      task.options = ['--no-color', '--out', 'rubocop.xml']
    end
  end
rescue LoadError
  # 'Rubocop not loaded.'
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_scc_manager-4.0.0 lib/tasks/rubocop.rake
foreman_scc_manager-3.1.1 lib/tasks/rubocop.rake
foreman_scc_manager-3.1.0 lib/tasks/rubocop.rake
foreman_scc_manager-3.0.0 lib/tasks/rubocop.rake