Skip to content

Commit

Permalink
rake: Make deep_merge() merge like Ruby's merge()
Browse files Browse the repository at this point in the history
... and explicitly set extend_existing_arrays to true.
  • Loading branch information
ribose-jeffreylau committed Nov 9, 2023
1 parent 6fe6849 commit 88d605f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ namespace :build do
aggregation = src.reduce({}) do |acc, file|
full_path = path_in_project(file)
y = YAML.safe_load(File.read(full_path))
acc.deep_merge(y)
acc.deep_merge!(
y,
extend_existing_arrays: true,
)
end

target_full_path = path_in_project(to)
Expand Down
6 changes: 3 additions & 3 deletions ci/rubocop.rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Style/ClassVars:
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
Enabled: false
Style/CollectionMethods:
Enabled: true
Enabled: false
PreferredMethods:
find: detect
inject: reduce
Expand Down Expand Up @@ -232,7 +232,7 @@ Naming/BinaryOperatorParameterName:
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
Enabled: false
Metrics/ParameterLists:
Description: Avoid parameter lists longer than three or four parameters.
Description: Avoid long parameter lists.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
Enabled: true
Max: 5
Expand Down Expand Up @@ -355,7 +355,7 @@ Layout/ConditionPosition:
Layout/DotPosition:
Description: Checks the position of the dot in multi-line method calls.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
EnforcedStyle: trailing
EnforcedStyle: leading
Layout/ExtraSpacing:
Description: Do not use unnecessary spacing.
Enabled: true
Expand Down
6 changes: 3 additions & 3 deletions ci/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Style/ClassVars:
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
Enabled: false
Style/CollectionMethods:
Enabled: true
Enabled: false
PreferredMethods:
find: detect
inject: reduce
Expand Down Expand Up @@ -229,7 +229,7 @@ Naming/BinaryOperatorParameterName:
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
Enabled: false
Metrics/ParameterLists:
Description: Avoid parameter lists longer than three or four parameters.
Description: Avoid long parameter lists.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
Enabled: true
Max: 5
Expand Down Expand Up @@ -352,7 +352,7 @@ Layout/ConditionPosition:
Layout/DotPosition:
Description: Checks the position of the dot in multi-line method calls.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
EnforcedStyle: trailing
EnforcedStyle: leading
Layout/ExtraSpacing:
Description: Do not use unnecessary spacing.
Enabled: true
Expand Down

0 comments on commit 88d605f

Please sign in to comment.