lib/rubocop/config_loader.rb in rubocop-0.58.2 vs lib/rubocop/config_loader.rb in rubocop-0.59.0

- old
+ new

@@ -93,10 +93,11 @@ def add_excludes_from_files(config, config_file) found_files = find_files_upwards(DOTFILE, config_file, use_home: true) return if found_files.empty? return if PathUtil.relative_path(found_files.last) == PathUtil.relative_path(config_file) + print 'AllCops/Exclude ' if debug? config.add_excludes_from_higher_level(load_file(found_files.last)) end def default_configuration @@ -127,9 +128,10 @@ file_string = " #{AUTO_GENERATED_FILE}" if File.exist?(DOTFILE) files = Array(load_yaml_configuration(DOTFILE)['inherit_from']) return if files.include?(AUTO_GENERATED_FILE) + files.unshift(AUTO_GENERATED_FILE) file_string = "\n - " + files.join("\n - ") if files.size > 1 rubocop_yml_contents = IO.read(DOTFILE, encoding: Encoding::UTF_8) .sub(/^inherit_from: *[.\w]+/, '') .sub(/^inherit_from: *(\n *- *[.\w]+)+/, '')