Skip to content

Commit 96f711a

Browse files
committed
(PUP-11841) Fix Style/RedundantFreeze
Now that all strings are frozen, it's redundant to call String#freeze.
1 parent 3170daa commit 96f711a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+190
-190
lines changed

lib/hiera/scope.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ class Hiera
44
class Scope
55
extend Forwardable
66

7-
CALLING_CLASS = 'calling_class'.freeze
8-
CALLING_CLASS_PATH = 'calling_class_path'.freeze
9-
CALLING_MODULE = 'calling_module'.freeze
10-
MODULE_NAME = 'module_name'.freeze
7+
CALLING_CLASS = 'calling_class'
8+
CALLING_CLASS_PATH = 'calling_class_path'
9+
CALLING_MODULE = 'calling_module'
10+
MODULE_NAME = 'module_name'
1111

1212
CALLING_KEYS = [CALLING_CLASS, CALLING_CLASS_PATH, CALLING_MODULE].freeze
13-
EMPTY_STRING = ''.freeze
13+
EMPTY_STRING = ''
1414

1515
attr_reader :real
1616

lib/puppet/application/lookup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class Puppet::Application::Lookup < Puppet::Application
88

99
RUN_HELP = _("Run 'puppet lookup --help' for more details").freeze
10-
DEEP_MERGE_OPTIONS = '--knock-out-prefix, --sort-merged-arrays, and --merge-hash-arrays'.freeze
10+
DEEP_MERGE_OPTIONS = '--knock-out-prefix, --sort-merged-arrays, and --merge-hash-arrays'
1111
TRUSTED_INFORMATION_FACTS = ["hostname", "domain", "fqdn", "clientcert"].freeze
1212

1313
run_mode :server

lib/puppet/context/trusted_information.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ def self.deep_freeze(object)
110110

111111
def to_h
112112
{
113-
'authenticated'.freeze => authenticated,
114-
'certname'.freeze => certname,
115-
'extensions'.freeze => extensions,
116-
'hostname'.freeze => hostname,
117-
'domain'.freeze => domain,
118-
'external'.freeze => external,
113+
'authenticated' => authenticated,
114+
'certname' => certname,
115+
'extensions' => extensions,
116+
'hostname' => hostname,
117+
'domain' => domain,
118+
'external' => external,
119119
}.freeze
120120
end
121121
end

lib/puppet/face/help.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ def all_application_summaries()
191191
end
192192
end
193193

194-
COMMON = 'Common:'.freeze
195-
SPECIALIZED = 'Specialized:'.freeze
196-
BLANK = "\n".freeze
194+
COMMON = 'Common:'
195+
SPECIALIZED = 'Specialized:'
196+
BLANK = "\n"
197197
def available_application_names_special_sort()
198198
full_list = Puppet::Application.available_application_names
199199
a_list = full_list & %w{apply agent config help lookup module resource}

lib/puppet/file_system/path_pattern.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Puppet::FileSystem
66
class PathPattern
77
class InvalidPattern < Puppet::Error; end
88

9-
DOTDOT = '..'.freeze
9+
DOTDOT = '..'
1010
ABSOLUTE_UNIX = /^\//
1111
ABSOLUTE_WINDOWS = /^[a-z]:/i
1212
CURRENT_DRIVE_RELATIVE_WINDOWS = /^\\/

lib/puppet/forge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Puppet::Forge < SemanticPuppet::Dependency::Source
1616

1717
include Puppet::Forge::Errors
1818

19-
USER_AGENT = "PMT/1.1.1 (v3; Net::HTTP)".freeze
19+
USER_AGENT = "PMT/1.1.1 (v3; Net::HTTP)"
2020

2121
# From https://forgeapi.puppet.com/#!/release/getReleases
2222
MODULE_RELEASE_EXCLUSIONS=%w[readme changelog license uri module tags supported file_size downloads created_at updated_at deleted_at].join(',').freeze

lib/puppet/functions.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,11 +685,11 @@ class Function3x < InternalFunction
685685
# Table of optimized parameter names - 0 to 5 parameters
686686
PARAM_NAMES = [
687687
[],
688-
['p0'.freeze].freeze,
689-
['p0'.freeze, 'p1'.freeze].freeze,
690-
['p0'.freeze, 'p1'.freeze, 'p2'.freeze].freeze,
691-
['p0'.freeze, 'p1'.freeze, 'p2'.freeze, 'p3'.freeze].freeze,
692-
['p0'.freeze, 'p1'.freeze, 'p2'.freeze, 'p3'.freeze, 'p4'.freeze].freeze,
688+
['p0'].freeze,
689+
['p0', 'p1'].freeze,
690+
['p0', 'p1', 'p2'].freeze,
691+
['p0', 'p1', 'p2', 'p3'].freeze,
692+
['p0', 'p1', 'p2', 'p3', 'p4'].freeze,
693693
]
694694

695695
# Creates an anonymous Function3x class that wraps a 3x function

lib/puppet/http.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module Puppet
88
# @see Puppet::HTTP::Response
99
# @api public
1010
module HTTP
11-
ACCEPT_ENCODING = "gzip;q=1.0,deflate;q=0.6,identity;q=0.3".freeze
12-
HEADER_PUPPET_VERSION = "X-Puppet-Version".freeze
11+
ACCEPT_ENCODING = "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
12+
HEADER_PUPPET_VERSION = "X-Puppet-Version"
1313

1414
require_relative 'http/errors'
1515
require_relative 'http/site'

lib/puppet/http/service/ca.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Puppet::HTTP::Service::Ca < Puppet::HTTP::Service
77
HEADERS = { 'Accept' => 'text/plain' }.freeze
88

99
# @return [String] default API for the ca service
10-
API = '/puppet-ca/v1'.freeze
10+
API = '/puppet-ca/v1'
1111

1212
# Use `Puppet::HTTP::Session.route_to(:ca)` to create or get an instance of this class.
1313
#

lib/puppet/http/service/compiler.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# @api public
66
class Puppet::HTTP::Service::Compiler < Puppet::HTTP::Service
77
# @return [String] Default API for the Compiler service
8-
API = '/puppet/v3'.freeze
8+
API = '/puppet/v3'
99

1010
# Use `Puppet::HTTP::Session.route_to(:puppet)` to create or get an instance of this class.
1111
#

0 commit comments

Comments
 (0)