From 74471499e60ed3fd72356eafd63ebc8118e138d7 Mon Sep 17 00:00:00 2001 From: Guillaume Rischard Date: Fri, 6 Oct 2023 17:00:57 -0400 Subject: [PATCH] Freeze mutable objects assigned to constants Fixes cookstyle complaint: Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead. Inspecting 597 files ...............................................................C..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... Offenses: cookbooks/db/recipes/master.rb:87:22: C: [Correctable] Style/MutableConstant: Freeze mutable objects assigned to constants. CGIMAP_PERMISSIONS = { ... ^ cookbooks/db/recipes/master.rb:122:26: C: [Correctable] Style/MutableConstant: Freeze mutable objects assigned to constants. PLANETDUMP_PERMISSIONS = { ... ^ cookbooks/db/recipes/master.rb:128:26: C: [Correctable] Style/MutableConstant: Freeze mutable objects assigned to constants. PLANETDIFF_PERMISSIONS = { ... ^ 597 files inspected, 3 offenses detected, 3 offenses auto-correctable --- cookbooks/db/recipes/master.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbooks/db/recipes/master.rb b/cookbooks/db/recipes/master.rb index 6ba23cb50..636cd60dc 100644 --- a/cookbooks/db/recipes/master.rb +++ b/cookbooks/db/recipes/master.rb @@ -117,13 +117,13 @@ "way_nodes" => [:select, :insert], "way_tags" => [:select, :insert], "ways" => [:select, :insert] -} +}.freeze PLANETDUMP_PERMISSIONS = { "note_comments" => :select, "notes" => :select, "users" => :select -} +}.freeze PLANETDIFF_PERMISSIONS = { "changeset_comments" => :select, @@ -138,7 +138,7 @@ "way_nodes" => :select, "way_tags" => :select, "ways" => :select -} +}.freeze %w[ acls