Sha256: 919d94ad5df4917d905985a7a9f6526bf93a87a10a2d3c502f399c4d8e34aae3
Contents?: true
Size: 661 Bytes
Versions: 4
Compression:
Stored size: 661 Bytes
Contents
# frozen_string_literal: true require 'rubocop' desc 'Generate a new cop template' task :new_cop, [:cop] do |_task, args| cop_name = args.fetch(:cop) do warn 'usage: bundle exec rake new_cop[Department/Name]' exit! end github_user = `git config github.user`.chop github_user = 'your_id' 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/itamae_cops.rb') begin generator.inject_config(config_file_path: 'config/default.yml') rescue TypeError # nop end # puts generator.todo end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
rubocop-itamae-0.1.5 | tasks/new_cop.rake |
rubocop-itamae-0.1.4 | tasks/new_cop.rake |
rubocop-itamae-0.1.3 | tasks/new_cop.rake |
rubocop-itamae-0.1.2 | tasks/new_cop.rake |