Sha256: b16d510b0100fba2266a7f35c314365bf9d315369f6a8dd38f8543b2bb2a574c

Contents?: true

Size: 1022 Bytes

Versions: 16

Compression:

Stored size: 1022 Bytes

Contents

# frozen_string_literal: true

require("bundler/gem_tasks")

Dir["tasks/**/*.rake"].each { |t| load t }

require "rubocop/rake_task"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec) do |spec|
  spec.pattern = FileList["spec/**/*_spec.rb"]
end

task(default: [:documentation_syntax_check, :generate_cops_documentation, :spec])

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/sorbet_cops.rb")
  generator.inject_config(config_file_path: "config/default.yml")

  # We don't use Rubocop's changelog automation workflow
  todo_without_changelog_instruction = generator.todo
    .sub(/$\s+4\. Run.*changelog.*for your new cop\.$/m, "")
  puts todo_without_changelog_instruction
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rubocop-sorbet-0.8.7 Rakefile
rubocop-sorbet-0.8.6 Rakefile
rubocop-sorbet-0.8.5 Rakefile
rubocop-sorbet-0.8.4 Rakefile
rubocop-sorbet-0.8.3 Rakefile
rubocop-sorbet-0.8.2 Rakefile
rubocop-sorbet-0.8.1 Rakefile
rubocop-sorbet-0.8.0 Rakefile
rubocop-sorbet-0.7.8 Rakefile
rubocop-sorbet-0.7.7 Rakefile
rubocop-sorbet-0.7.6 Rakefile
rubocop-sorbet-0.7.5 Rakefile
rubocop-sorbet-0.7.4 Rakefile
rubocop-sorbet-0.7.3 Rakefile
rubocop-sorbet-0.7.2 Rakefile
rubocop-sorbet-0.7.1 Rakefile