Skip to content

Commit 19bdb37

Browse files
committed
Layout/LeadingCommentSpace
This commit enables the Rubocop Layout/LeadingCommentSpace cop and addresses all offenses.
1 parent d181f5f commit 19bdb37

File tree

140 files changed

+319
-324
lines changed

Some content is hidden

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

140 files changed

+319
-324
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ I18n/GetText/DecorateStringFormattingUsingPercent:
2222
I18n/RailsI18n/DecorateString:
2323
Enabled: false
2424

25-
# This cop supports safe auto-correction (--auto-correct).
26-
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
27-
Layout/LeadingCommentSpace:
28-
Enabled: false
29-
3025
# This cop supports safe auto-correction (--auto-correct).
3126
Layout/LeadingEmptyLines:
3227
Exclude:

lib/hiera/puppet_function.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def hiera_block2(scope, key, override, &default_block)
6262

6363
def lookup(scope, key, default, has_default, override, &default_block)
6464
unless Puppet[:strict] == :off
65-
#TRANSLATORS 'lookup' is a puppet function and should not be translated
65+
# TRANSLATORS 'lookup' is a puppet function and should not be translated
6666
message = _("The function '%{class_name}' is deprecated in favor of using 'lookup'.") % { class_name: self.class.name }
6767
message += ' '+ _("See https://puppet.com/docs/puppet/%{minor_version}/deprecated_language.html") %
6868
{ minor_version: Puppet.minor_version }

lib/puppet/application/agent.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def run_command
400400
end
401401

402402
def log_config
403-
#skip also config reading and parsing if debug is not enabled
403+
# skip also config reading and parsing if debug is not enabled
404404
return unless Puppet::Util::Log.sendlevel?(:debug)
405405

406406
Puppet.settings.stringify_settings(:agent, :all).each_pair do |k,v|

lib/puppet/configurer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require 'timeout'
55
require_relative '../puppet/util'
66
require 'securerandom'
7-
#require 'puppet/parser/script_compiler'
7+
# require 'puppet/parser/script_compiler'
88
require_relative '../puppet/pops/evaluator/deferred_resolver'
99

1010
class Puppet::Configurer
@@ -330,7 +330,7 @@ def run(options = {})
330330
raise Puppet::Error, detail
331331
end
332332
else
333-
#TRANSLATORS 'server_list' is the name of a setting and should not be translated
333+
# TRANSLATORS 'server_list' is the name of a setting and should not be translated
334334
Puppet.debug _("Selected puppet server from the `server_list` setting: %{server}:%{port}") % { server: server, port: port }
335335
report.server_used = "#{server}:#{port}"
336336
end
@@ -559,7 +559,7 @@ def find_functional_server
559559
Puppet.debug(_("Puppet server %{host}:%{port} is unavailable: %{code} %{reason}") %
560560
{ host: e.response.url.host, port: e.response.url.port, code: e.response.code, reason: e.response.reason })
561561
rescue => detail
562-
#TRANSLATORS 'server_list' is the name of a setting and should not be translated
562+
# TRANSLATORS 'server_list' is the name of a setting and should not be translated
563563
Puppet.debug _("Unable to connect to server from server_list setting: %{detail}") % {detail: detail}
564564
end
565565
[nil, nil]

lib/puppet/configurer/fact_handler.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def facts_for_uploading
3434
end
3535

3636
def encode_facts(facts)
37-
#facts = find_facts
37+
# facts = find_facts
3838

3939
# NOTE: :facts specified as parameters are URI encoded here,
4040
# then encoded for a second time depending on their length:

lib/puppet/daemon.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def run_event_loop
173173
end
174174

175175
signal_loop = Puppet::Scheduler.create_job(SIGNAL_CHECK_INTERVAL) do
176-
while method = @signals.shift #rubocop:disable Lint/AssignmentInCondition
176+
while method = @signals.shift # rubocop:disable Lint/AssignmentInCondition
177177
Puppet.notice "Processing #{method}"
178178
send(method)
179179
end

lib/puppet/etc.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def endpwent
7070
::Etc.endpwent
7171
end
7272

73-
#effectively equivalent to IO#rewind of /etc/passwd
73+
# effectively equivalent to IO#rewind of /etc/passwd
7474
def setpwent
7575
::Etc.setpwent
7676
end
@@ -116,7 +116,7 @@ def group
116116

117117
setgrent
118118
begin
119-
while cur_group = getgrent #rubocop:disable Lint/AssignmentInCondition
119+
while cur_group = getgrent # rubocop:disable Lint/AssignmentInCondition
120120
yield cur_group
121121
end
122122
ensure

lib/puppet/face/config.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
DEFAULT_SECTION_MARKER = Object.new
1818
DEFAULT_SECTION = "main"
1919
option "--section " + _("SECTION_NAME") do
20-
default_to { DEFAULT_SECTION_MARKER } #Sentinel object for default detection during commands
20+
default_to { DEFAULT_SECTION_MARKER } # Sentinel object for default detection during commands
2121
summary _("The section of the configuration file to interact with.")
2222
description <<-EOT
2323
The section of the puppet.conf configuration file to interact with.
@@ -100,9 +100,9 @@ def warn_default_section(section_name)
100100
messages = []
101101
messages << _("No section specified; defaulting to '%{section_name}'.") %
102102
{ section_name: section_name }
103-
#TRANSLATORS '--section' is a command line option and should not be translated
103+
# TRANSLATORS '--section' is a command line option and should not be translated
104104
messages << _("Set the config section by using the `--section` flag.")
105-
#TRANSLATORS `puppet config --section user print foo` is a command line example and should not be translated
105+
# TRANSLATORS `puppet config --section user print foo` is a command line example and should not be translated
106106
messages << _("For example, `puppet config --section user print foo`.")
107107
messages << _("For more information, see https://puppet.com/docs/puppet/latest/configuration.html")
108108

@@ -201,7 +201,7 @@ def report_section_and_environment(section_name, environment_name)
201201
action(:delete) do
202202
summary _("Delete a Puppet setting.")
203203
arguments _("<setting>")
204-
#TRANSLATORS 'main' is a specific section name and should not be translated
204+
# TRANSLATORS 'main' is a specific section name and should not be translated
205205
description "Deletes a setting from the specified section. (The default is the section 'main')."
206206
notes <<-'EOT'
207207
By default, this action deletes the configuration setting from the 'main'
@@ -257,7 +257,7 @@ def report_section_and_environment(section_name, environment_name)
257257
end
258258
end
259259
else
260-
#TRANSLATORS the 'puppet.conf' is a specific file and should not be translated
260+
# TRANSLATORS the 'puppet.conf' is a specific file and should not be translated
261261
Puppet.warning(_("The puppet.conf file does not exist %{puppet_conf}") % { puppet_conf: path })
262262
end
263263
nil

lib/puppet/face/help.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
end
4343

4444
if args.length > 2
45-
#TRANSLATORS 'puppet help' is a command line and should not be translated
45+
# TRANSLATORS 'puppet help' is a command line and should not be translated
4646
raise ArgumentError, _("The 'puppet help' command takes two (optional) arguments: a subcommand and an action")
4747
end
4848

@@ -52,7 +52,7 @@
5252
version = options[:version]
5353
else
5454
if args.length == 0
55-
#TRANSLATORS '--version' is a command line option and should not be translated
55+
# TRANSLATORS '--version' is a command line option and should not be translated
5656
raise ArgumentError, _("Supplying a '--version' only makes sense when a Faces subcommand is given")
5757
end
5858
end
@@ -211,7 +211,7 @@ def horribly_extract_summary_from(appname)
211211
# depends on the implementation coincidence of how our pages are
212212
# formatted. If we can't match the pattern we expect we return the empty
213213
# string to ensure we don't blow up in the summary. --daniel 2011-04-11
214-
while line = help.shift do #rubocop:disable Lint/AssignmentInCondition
214+
while line = help.shift do # rubocop:disable Lint/AssignmentInCondition
215215
md = /^puppet-#{appname}\([^\)]+\) -- (.*)$/.match(line)
216216
if md
217217
return md[1]
@@ -222,15 +222,15 @@ def horribly_extract_summary_from(appname)
222222
# This should absolutely be a private method, but for some reason it appears
223223
# that you can't use the 'private' keyword inside of a Face definition.
224224
# See #14205.
225-
#private :horribly_extract_summary_from
225+
# private :horribly_extract_summary_from
226226

227227
def exclude_from_docs?(appname)
228228
%w{face_base indirection_base report status}.include? appname
229229
end
230230
# This should absolutely be a private method, but for some reason it appears
231231
# that you can't use the 'private' keyword inside of a Face definition.
232232
# See #14205.
233-
#private :exclude_from_docs?
233+
# private :exclude_from_docs?
234234

235235
def is_face_app?(appname)
236236
clazz = Puppet::Application.find(appname)
@@ -240,5 +240,5 @@ def is_face_app?(appname)
240240
# This should probably be a private method, but for some reason it appears
241241
# that you can't use the 'private' keyword inside of a Face definition.
242242
# See #14205.
243-
#private :is_face_app?
243+
# private :is_face_app?
244244
end

lib/puppet/face/node.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
find = get_action(:find)
2020
find.summary _("Retrieve a node object.")
2121
find.arguments _("<host>")
22-
#TRANSLATORS the following are specific names and should not be translated `classes`, `environment`, `expiration`, `name`, `parameters`, Puppet::Node
22+
# TRANSLATORS the following are specific names and should not be translated `classes`, `environment`, `expiration`, `name`, `parameters`, Puppet::Node
2323
find.returns _(<<-'EOT')
2424
A hash containing the node's `classes`, `environment`, `expiration`, `name`,
2525
`parameters` (its facts, combined with any ENC-set parameters), and `time`.

0 commit comments

Comments
 (0)