Skip to content

Commit

Permalink
Use RuboCop Performance's version when generating new cop
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiMisiura committed Aug 1, 2020
1 parent ace0280 commit 2508ab3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ task :new_cop, [:cop] do |_task, args|
generator.inject_require(
root_file_path: 'lib/rubocop/cop/performance_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::Performance::Version::STRING.split('.')

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

0 comments on commit 2508ab3

Please sign in to comment.