lib/rubocop/config_loader.rb in rubocop-0.71.0 vs lib/rubocop/config_loader.rb in rubocop-0.72.0
- old
+ new
@@ -142,14 +142,10 @@
write_config_file(config_file, file_string, rubocop_yml_contents)
puts "Added inheritance from `#{AUTO_GENERATED_FILE}` in `#{DOTFILE}`."
end
- def required_features
- resolver.required_features
- end
-
private
def find_project_dotfile(target_dir)
find_file_upwards(DOTFILE, target_dir)
end
@@ -175,11 +171,11 @@
path
end
def existing_configuration(config_file)
IO.read(config_file, encoding: Encoding::UTF_8)
- .sub(%r{^inherit_from: *[.\/\w]+}, '')
- .sub(%r{^inherit_from: *(\n *- *[.\/\w]+)+}, '')
+ .sub(/^inherit_from: *[^\n]+/, '')
+ .sub(/^inherit_from: *(\n *- *[^\n]+)+/, '')
end
def write_config_file(file_name, file_string, rubocop_yml_contents)
File.open(file_name, 'w') do |f|
f.write "inherit_from:#{file_string}\n"