From 2508ab3d20e7e46e1c6a70fbea0deff128c9478e Mon Sep 17 00:00:00 2001 From: SerhiiMisiura Date: Sat, 1 Aug 2020 14:38:29 +0900 Subject: [PATCH] Use RuboCop Performance's version when generating new cop Follow https://github.com/rubocop-hq/rubocop/pull/7897. --- Rakefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 206d552..107b049 100644 --- a/Rakefile +++ b/Rakefile @@ -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