Sha256: 4513e6fe681fb5ded77109c93a3001c13713bed66a62b1f2b230941f6fd3c08e

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "rubocop"
require "rubocop-performance"
require "rubocop-rails"
require "rubocop-rspec"

RSpec::Core::RakeTask.new(:spec)

task default: :spec

desc 'Print out comments that can be used for a GitHub cop election'
task :election do # rubocop:disable Rails/RakeEnvironment
  configuration_path = File.expand_path('default.yml', File.dirname(__FILE__))
  RuboCop::ConfigLoader.load_file(configuration_path).pending_cops.each do |pending_cop|
    base_urls = {
      'layout' => 'https://docs.rubocop.org/rubocop/cops_layout.html#layout',
      'lint' => 'https://docs.rubocop.org/rubocop/cops_lint.html#lint',
      'style' => 'https://docs.rubocop.org/rubocop/cops_style.html#style',
      'performance' => 'https://docs.rubocop.org/rubocop-performance/cops_performance.html#performance',
      'rails' => 'https://docs.rubocop.org/rubocop-rails/cops_rails.html#rails',
      'rspec' => 'https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspec',
    }
    department, anchor = pending_cop.name.downcase.split('/')
    puts <<~COMMENT
      [**#{pending_cop.name}**](#{base_urls.fetch(department)}#{anchor})
      #{pending_cop.metadata.fetch('Description')}

    COMMENT
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ws-style-6.6.0 Rakefile
ws-style-6.5.3 Rakefile
ws-style-6.5.2 Rakefile
ws-style-6.5.1 Rakefile
ws-style-6.5.0 Rakefile