Sha256: 1372d2adf0622b889a11341006607a6684a3300a4eea813bfb5d6b9f48415d23

Contents?: true

Size: 710 Bytes

Versions: 23

Compression:

Stored size: 710 Bytes

Contents

# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
  t.libs << 'test'
  t.libs << 'lib'
  t.test_files = FileList['test/**/*_test.rb']
end

task default: :test

desc 'Generate a new cop with a template'
task :new_cop, [:cop] do |_task, args|
  require 'rubocop'

  cop_name = args.fetch(:cop) do
    warn 'usage: bundle exec rake new_cop[Department/Name]'
    exit!
  end

  generator = RuboCop::Cop::Generator.new(cop_name)

  generator.write_source
  generator.write_spec
  generator.inject_require(root_file_path: 'lib/rubocop/cop/codeur_cops.rb')
  generator.inject_config(config_file_path: 'config/default.yml')

  puts generator.todo
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rubocop-codeur-0.9.8 Rakefile
rubocop-codeur-0.9.5 Rakefile
rubocop-codeur-0.9.4 Rakefile
rubocop-codeur-0.9.3 Rakefile
rubocop-codeur-0.9.2 Rakefile
rubocop-codeur-0.9.1 Rakefile
rubocop-codeur-0.9.0 Rakefile
rubocop-codeur-0.8.1 Rakefile
rubocop-codeur-0.8.0 Rakefile
rubocop-codeur-0.7.4 Rakefile
rubocop-codeur-0.7.3 Rakefile
rubocop-codeur-0.7.1 Rakefile
rubocop-codeur-0.7.0 Rakefile
rubocop-codeur-0.6.1 Rakefile
rubocop-codeur-0.5.0 Rakefile
rubocop-codeur-0.4.3 Rakefile
rubocop-codeur-0.4.2 Rakefile
rubocop-codeur-0.4.1 Rakefile
rubocop-codeur-0.4.0 Rakefile
rubocop-codeur-0.3.0 Rakefile