Skip to content

Commit

Permalink
Merge pull request #905 from tejasbubane/generator-version-added
Browse files Browse the repository at this point in the history
Use rubocop-rspec's version while generating new cop
  • Loading branch information
bquorning committed May 10, 2020
2 parents 9d17505 + 7b77a7b commit 95f0985
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 95f0985

Please sign in to comment.