Skip to content

Commit

Permalink
Allow extensions inject their defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
pirj authored and bbatsov committed Dec 19, 2022
1 parent 0732939 commit a143510
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/rubocop/config_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ def default_configuration
end
end

def inject_defaults!(project_root)
path = File.join(project_root, 'config', 'default.yml')
config = load_file(path)
new_config = ConfigLoader.merge_with_default(config, path)
puts "configuration from #{path}" if debug?
@default_configuration = new_config
end

# Returns the path RuboCop inferred as the root of the project. No file
# searches will go past this directory.
# @deprecated Use `RuboCop::ConfigFinder.project_root` instead.
Expand Down

0 comments on commit a143510

Please sign in to comment.