Skip to content

Commit

Permalink
Use rubocop-rspec's version while generating new cop
Browse files Browse the repository at this point in the history
Default rake task for creating new cop adds rubocop's version to
config file, use rubocop-rspec's version instead.

Waiting for rubocop/rubocop#7897 to be merged.
  • Loading branch information
tejasbubane committed May 10, 2020
1 parent b5c18e1 commit 7b77a7b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ task :new_cop, [:cop] do |_task, args|
generator.write_source
generator.write_spec
generator.inject_require(root_file_path: 'lib/rubocop/cop/rspec_cops.rb')
generator.inject_config(config_file_path: 'config/default.yml')
generator.inject_config(config_file_path: 'config/default.yml',
version_added: bump_minor_version)

puts generator.todo
end

def bump_minor_version
major, minor, _patch = RuboCop::RSpec::Version::STRING.split('.')

"#{major}.#{minor.succ}.0"
end

0 comments on commit 7b77a7b

Please sign in to comment.