Sha256: 56d68b6268c6057056d3eeaec8c4dbd98e80df480a59b06503fbaa2bdd440078

Contents?: true

Size: 938 Bytes

Versions: 9

Compression:

Stored size: 938 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

  github_user = %x(git config github.user).chop
  github_user = "Shopify" if github_user.empty?

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

  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")

  puts generator.todo
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubocop-sorbet-0.6.11 Rakefile
rubocop-sorbet-0.6.10 Rakefile
rubocop-sorbet-0.6.9 Rakefile
rubocop-sorbet-0.6.8 Rakefile
rubocop-sorbet-0.6.7 Rakefile
rubocop-sorbet-0.6.6 Rakefile
rubocop-sorbet-0.6.5 Rakefile
rubocop-sorbet-0.6.4 Rakefile
rubocop-sorbet-0.6.3 Rakefile