Skip to content

Commit 9ceca21

Browse files
authored
Merge pull request #9187 from mhashizume/PUP-11768/main/more-layout-cops
(PUP-11768) More Rubocop layout cops
2 parents 4ae7055 + e7492be commit 9ceca21

File tree

1,009 files changed

+2272
-964
lines changed

Some content is hidden

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

1,009 files changed

+2272
-964
lines changed

.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ Layout/BeginEndAlignment:
2828
Exclude:
2929
- 'lib/puppet/provider/package/*.rb'
3030

31+
Layout/ElseAlignment:
32+
Enabled: true
33+
Exclude:
34+
- 'lib/puppet/provider/package/*.rb'
35+
3136
# puppet uses symbol booleans in types and providers to work around long standing
3237
# bugs when trying to manage falsey pararameters and properties
3338
Lint/BooleanSymbol:

.rubocop_todo.yml

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

25-
# This cop supports safe auto-correction (--auto-correct).
26-
Layout/ClosingParenthesisIndentation:
27-
Enabled: false
28-
29-
# This cop supports safe auto-correction (--auto-correct).
30-
# Configuration parameters: AllowForAlignment.
31-
Layout/CommentIndentation:
32-
Enabled: false
33-
34-
# This cop supports safe auto-correction (--auto-correct).
35-
# Configuration parameters: EnforcedStyle.
36-
# SupportedStyles: leading, trailing
37-
Layout/DotPosition:
38-
Enabled: false
39-
40-
# This cop supports safe auto-correction (--auto-correct).
41-
Layout/ElseAlignment:
42-
Enabled: false
43-
44-
# This cop supports safe auto-correction (--auto-correct).
45-
Layout/EmptyLineAfterGuardClause:
46-
Enabled: false
47-
48-
# This cop supports safe auto-correction (--auto-correct).
49-
Layout/EmptyLineAfterMagicComment:
50-
Enabled: false
51-
52-
# This cop supports safe auto-correction (--auto-correct).
53-
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
54-
Layout/EmptyLineBetweenDefs:
55-
Enabled: false
56-
57-
# This cop supports safe auto-correction (--auto-correct).
58-
Layout/EmptyLines:
59-
Enabled: false
60-
61-
# This cop supports safe auto-correction (--auto-correct).
62-
# Configuration parameters: EnforcedStyle.
63-
# SupportedStyles: around, only_before
64-
Layout/EmptyLinesAroundAccessModifier:
65-
Enabled: false
66-
67-
# This cop supports safe auto-correction (--auto-correct).
68-
Layout/EmptyLinesAroundArguments:
69-
Exclude:
70-
- 'lib/puppet/defaults.rb'
71-
- 'lib/puppet/parser/functions/sprintf.rb'
72-
- 'lib/puppet/settings.rb'
73-
- 'lib/puppet/type.rb'
74-
- 'lib/puppet/type/schedule.rb'
75-
- 'lib/puppet/util/diff.rb'
76-
- 'lib/puppet/util/rdoc/generators/puppet_generator.rb'
77-
- 'lib/puppet/util/rdoc/generators/template/puppet/puppet.rb'
78-
- 'lib/puppet/util/windows/com.rb'
79-
80-
# This cop supports safe auto-correction (--auto-correct).
81-
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
82-
# AllowedMethods: alias_method, public, protected, private
83-
Layout/EmptyLinesAroundAttributeAccessor:
84-
Enabled: false
85-
86-
# This cop supports safe auto-correction (--auto-correct).
87-
Layout/EmptyLinesAroundBeginBody:
88-
Exclude:
89-
- 'lib/puppet/util/diff.rb'
90-
- 'lib/puppet/util/retry_action.rb'
91-
92-
# This cop supports safe auto-correction (--auto-correct).
93-
# Configuration parameters: EnforcedStyle.
94-
# SupportedStyles: empty_lines, no_empty_lines
95-
Layout/EmptyLinesAroundBlockBody:
96-
Enabled: false
97-
98-
# This cop supports safe auto-correction (--auto-correct).
99-
# Configuration parameters: EnforcedStyle.
100-
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
101-
Layout/EmptyLinesAroundClassBody:
102-
Enabled: false
103-
104-
# This cop supports safe auto-correction (--auto-correct).
105-
Layout/EmptyLinesAroundExceptionHandlingKeywords:
106-
Enabled: false
107-
108-
# This cop supports safe auto-correction (--auto-correct).
109-
Layout/EmptyLinesAroundMethodBody:
110-
Enabled: false
111-
112-
# This cop supports safe auto-correction (--auto-correct).
113-
# Configuration parameters: EnforcedStyle.
114-
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
115-
Layout/EmptyLinesAroundModuleBody:
116-
Enabled: false
117-
11825
# This cop supports safe auto-correction (--auto-correct).
11926
# Configuration parameters: EnforcedStyleAlignWith, Severity.
12027
# SupportedStylesAlignWith: keyword, variable, start_of_line

ext/windows/service/daemon.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def service_main(*argsv)
9696
end
9797
end
9898
@run_thread.join
99-
10099
rescue Exception => e
101100
log_exception(e)
102101
ensure

lib/hiera/puppet_function.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
require 'hiera_puppet'
34

45
# Provides the base class for the puppet functions hiera, hiera_array, hiera_hash, and hiera_include.

lib/hiera/scope.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
require 'forwardable'
34
class Hiera
45
class Scope
@@ -86,6 +87,5 @@ def find_hostclass(scope)
8687

8788
# This is needed for type conversion to work
8889
def_delegators :@real, :call_function
89-
9090
end
9191
end

lib/hiera_puppet.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
Puppet.features.hiera?
34
require 'hiera/scope'
45
require_relative 'puppet'

lib/puppet.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
require_relative 'puppet/version'
34
require_relative 'puppet/concurrent/synchronized'
45

lib/puppet/agent.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
require_relative '../puppet/application'
34
require_relative '../puppet/error'
45
require_relative '../puppet/util/at_fork'

lib/puppet/agent/disabler.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
require_relative '../../puppet/util/json_lockfile'
34

45
# This module is responsible for encapsulating the logic for
@@ -41,10 +42,10 @@ def disable_message
4142
if data.has_key?(DISABLED_MESSAGE_JSON_KEY)
4243
return data[DISABLED_MESSAGE_JSON_KEY]
4344
end
45+
4446
nil
4547
end
4648

47-
4849
def disable_lockfile
4950
@disable_lockfile ||= Puppet::Util::JsonLockfile.new(Puppet[:agent_disabled_lockfile])
5051

lib/puppet/agent/locker.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
require_relative '../../puppet/util/pidlock'
34
require_relative '../../puppet/error'
45

@@ -42,6 +43,4 @@ def lockfile
4243
@lockfile
4344
end
4445
private :lockfile
45-
46-
4746
end

0 commit comments

Comments
 (0)