]> git.openstreetmap.org Git - chef.git/commitdiff
Freeze mutable objects assigned to constants
authorGuillaume Rischard <git@stereo.lu>
Fri, 6 Oct 2023 21:00:57 +0000 (17:00 -0400)
committerGitHub <noreply@github.com>
Fri, 6 Oct 2023 21:00:57 +0000 (17:00 -0400)
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

index 6ba23cb50a1fab486cedeafa81b61a905564a578..636cd60dc9507c8e5bc2d5cee672f0591fbc6b85 100644 (file)
@@ -117,13 +117,13 @@ CGIMAP_PERMISSIONS = {
   "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 @@ PLANETDIFF_PERMISSIONS = {
   "way_nodes" => :select,
   "way_tags" => :select,
   "ways" => :select
-}
+}.freeze
 
 %w[
   acls