Skip to content

Commit 78ef5ef

Browse files
committed
(CONT-772) Correct Layout/HashAlignment
1 parent b8bdb96 commit 78ef5ef

15 files changed

+600
-631
lines changed

.rubocop_todo.yml

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-04-18 15:25:08 UTC using RuboCop version 1.48.1.
3+
# on 2023-04-19 16:57:14 UTC using RuboCop version 1.48.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 12
10-
# This cop supports safe autocorrection (--autocorrect).
11-
# Configuration parameters: EnforcedStyle, IndentationWidth.
12-
# SupportedStyles: with_first_argument, with_fixed_indentation
13-
Layout/ArgumentAlignment:
14-
Exclude:
15-
- 'spec/classes/mod/event_spec.rb'
16-
- 'spec/classes/mod/itk_spec.rb'
17-
- 'spec/classes/mod/lbmethod_bybusyness.rb'
18-
- 'spec/classes/mod/lbmethod_byrequests.rb'
19-
- 'spec/classes/mod/lbmethod_bytraffic.rb'
20-
- 'spec/classes/mod/lbmethod_heartbeat.rb'
21-
- 'spec/classes/mod/prefork_spec.rb'
22-
- 'spec/classes/mod/worker_spec.rb'
23-
249
# Offense count: 5
2510
# This cop supports safe autocorrection (--autocorrect).
2611
Layout/ClosingHeredocIndentation:
@@ -39,29 +24,6 @@ Layout/EmptyLineAfterGuardClause:
3924
- 'tasks/init.rb'
4025
- 'util/apache_mod_platform_support.rb'
4126

42-
# Offense count: 590
43-
# This cop supports safe autocorrection (--autocorrect).
44-
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
45-
# SupportedHashRocketStyles: key, separator, table
46-
# SupportedColonStyles: key, separator, table
47-
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
48-
Layout/HashAlignment:
49-
Exclude:
50-
- 'spec/classes/apache_spec.rb'
51-
- 'spec/classes/mod/event_spec.rb'
52-
- 'spec/classes/mod/itk_spec.rb'
53-
- 'spec/classes/mod/jk_spec.rb'
54-
- 'spec/classes/mod/lbmethod_bybusyness.rb'
55-
- 'spec/classes/mod/lbmethod_byrequests.rb'
56-
- 'spec/classes/mod/lbmethod_bytraffic.rb'
57-
- 'spec/classes/mod/lbmethod_heartbeat.rb'
58-
- 'spec/classes/mod/prefork_spec.rb'
59-
- 'spec/classes/mod/worker_spec.rb'
60-
- 'spec/classes/service_spec.rb'
61-
- 'spec/defines/custom_config_spec.rb'
62-
- 'spec/defines/vhost_spec.rb'
63-
- 'util/apache_mod_platform_support.rb'
64-
6527
# Offense count: 2
6628
# This cop supports safe autocorrection (--autocorrect).
6729
Layout/HeredocIndentation:
@@ -102,6 +64,13 @@ Layout/LineEndStringConcatenationIndentation:
10264
- 'spec/classes/mod/deflate_spec.rb'
10365
- 'spec/classes/mod/info_spec.rb'
10466

67+
# Offense count: 4
68+
# This cop supports safe autocorrection (--autocorrect).
69+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
70+
# URISchemes: http, https
71+
Layout/LineLength:
72+
Max: 202
73+
10574
# Offense count: 3
10675
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
10776
Lint/DuplicateBranch:

spec/classes/apache_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@
5050
['auth_basic', 'authn_file', 'authz_groupfile', 'authz_host', 'authz_user', 'dav', 'env'].each do |modname|
5151
it {
5252
is_expected.to contain_file("#{modname}.load").with(
53-
'path' => "/etc/apache2/mods-available/#{modname}.load",
53+
'path' => "/etc/apache2/mods-available/#{modname}.load",
5454
'ensure' => 'file',
5555
)
5656
}
5757
it {
5858
is_expected.to contain_file("#{modname}.load symlink").with(
59-
'path' => "/etc/apache2/mods-enabled/#{modname}.load",
59+
'path' => "/etc/apache2/mods-enabled/#{modname}.load",
6060
'ensure' => 'link',
6161
'target' => "/etc/apache2/mods-available/#{modname}.load",
6262
)
@@ -121,26 +121,26 @@
121121
['alias', 'autoindex', 'dav_fs', 'deflate', 'dir', 'mime', 'negotiation', 'setenvif'].each do |modname|
122122
it {
123123
is_expected.to contain_file("#{modname}.load").with(
124-
'path' => "/etc/apache2/mods-available/#{modname}.load",
124+
'path' => "/etc/apache2/mods-available/#{modname}.load",
125125
'ensure' => 'file',
126126
)
127127
}
128128
it {
129129
is_expected.to contain_file("#{modname}.load symlink").with(
130-
'path' => "/etc/apache2/mods-enabled/#{modname}.load",
130+
'path' => "/etc/apache2/mods-enabled/#{modname}.load",
131131
'ensure' => 'link',
132132
'target' => "/etc/apache2/mods-available/#{modname}.load",
133133
)
134134
}
135135
it {
136136
is_expected.to contain_file("#{modname}.conf").with(
137-
'path' => "/etc/apache2/mods-available/#{modname}.conf",
137+
'path' => "/etc/apache2/mods-available/#{modname}.conf",
138138
'ensure' => 'file',
139139
)
140140
}
141141
it {
142142
is_expected.to contain_file("#{modname}.conf symlink").with(
143-
'path' => "/etc/apache2/mods-enabled/#{modname}.conf",
143+
'path' => "/etc/apache2/mods-enabled/#{modname}.conf",
144144
'ensure' => 'link',
145145
'target' => "/etc/apache2/mods-available/#{modname}.conf",
146146
)
@@ -167,7 +167,7 @@
167167
describe 'Add extra LogFormats When parameter log_formats is a hash' do
168168
let :params do
169169
{ log_formats: {
170-
'vhost_common' => '%v %h %l %u %t "%r" %>s %b',
170+
'vhost_common' => '%v %h %l %u %t "%r" %>s %b',
171171
'vhost_combined' => '%v %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"',
172172
} }
173173
end
@@ -179,7 +179,7 @@
179179
describe 'Override existing LogFormats When parameter log_formats is a hash' do
180180
let :params do
181181
{ log_formats: {
182-
'common' => '%v %h %l %u %t "%r" %>s %b',
182+
'common' => '%v %h %l %u %t "%r" %>s %b',
183183
'combined' => '%v %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"',
184184
} }
185185
end
@@ -548,7 +548,7 @@
548548
['auth_basic', 'authn_core', 'authn_file', 'authz_groupfile', 'authz_host', 'authz_user', 'dav', 'env'].each do |modname|
549549
it {
550550
is_expected.to contain_file("#{modname}.load").with(
551-
'path' => "/usr/local/etc/apache24/Modules/#{modname}.load",
551+
'path' => "/usr/local/etc/apache24/Modules/#{modname}.load",
552552
'ensure' => 'file',
553553
)
554554
}
@@ -559,13 +559,13 @@
559559
['alias', 'autoindex', 'dav_fs', 'deflate', 'dir', 'mime', 'negotiation', 'setenvif'].each do |modname|
560560
it {
561561
is_expected.to contain_file("#{modname}.load").with(
562-
'path' => "/usr/local/etc/apache24/Modules/#{modname}.load",
562+
'path' => "/usr/local/etc/apache24/Modules/#{modname}.load",
563563
'ensure' => 'file',
564564
)
565565
}
566566
it {
567567
is_expected.to contain_file("#{modname}.conf").with(
568-
'path' => "/usr/local/etc/apache24/Modules/#{modname}.conf",
568+
'path' => "/usr/local/etc/apache24/Modules/#{modname}.conf",
569569
'ensure' => 'file',
570570
)
571571
}
@@ -615,7 +615,7 @@
615615
it {
616616
is_expected.to contain_package('httpd').with(
617617
'ensure' => 'installed',
618-
'name' => 'httpd24-httpd',
618+
'name' => 'httpd24-httpd',
619619
).that_notifies('Class[Apache::Service]')
620620
}
621621
end

spec/classes/mod/event_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124

125125
it {
126126
is_expected.to contain_file('/etc/httpd/conf.modules.d/event.load').with('ensure' => 'file',
127-
'content' => "LoadModule mpm_event_module modules/mod_mpm_event.so\n")
127+
'content' => "LoadModule mpm_event_module modules/mod_mpm_event.so\n")
128128
}
129129
end
130130
end

spec/classes/mod/itk_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
it {
5252
is_expected.to contain_file('/etc/httpd/conf.modules.d/itk.load').with('ensure' => 'file',
53-
'content' => "LoadModule mpm_itk_module modules/mod_mpm_itk.so\n")
53+
'content' => "LoadModule mpm_itk_module modules/mod_mpm_itk.so\n")
5454
}
5555
end
5656
context 'with enablecapabilities set' do

spec/classes/mod/jk_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
'worker_a' => {
2727
'type' => 'ajp13',
2828
'socket_keepalive' => 'true',
29-
'comment' => 'This is worker A',
29+
'comment' => 'This is worker A',
3030
},
3131
'worker_b' => {
3232
'type' => 'ajp13',
3333
'socket_keepalive' => 'true',
34-
'comment' => 'This is worker B',
34+
'comment' => 'This is worker B',
3535
},
3636
'worker_maintain' => 40,
3737
'worker_lists' => ['worker_a,worker_b'],

spec/classes/mod/lbmethod_bybusyness.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
it {
1717
is_expected.to contain_file('/etc/apache2/mods-enabled/lbmethod_byrequests.load').with('ensure' => 'file',
18-
'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n")
18+
'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n")
1919
}
2020
end
2121
end
@@ -31,7 +31,7 @@
3131

3232
it {
3333
is_expected.to contain_file('/etc/httpd/conf.modules.d/lbmethod_byrequests.load').with('ensure' => 'file',
34-
'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n")
34+
'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n")
3535
}
3636
end
3737
end

spec/classes/mod/lbmethod_byrequests.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
it {
1717
is_expected.to contain_file('/etc/apache2/mods-enabled/lbmethod_byrequests.load').with('ensure' => 'file',
18-
'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n")
18+
'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n")
1919
}
2020
end
2121
end
@@ -31,7 +31,7 @@
3131

3232
it {
3333
is_expected.to contain_file('/etc/httpd/conf.modules.d/lbmethod_byrequests.load').with('ensure' => 'file',
34-
'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n")
34+
'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n")
3535
}
3636
end
3737
end

spec/classes/mod/lbmethod_bytraffic.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
it {
1717
is_expected.to contain_file('/etc/apache2/mods-enabled/lbmethod_byrequests.load').with('ensure' => 'file',
18-
'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n")
18+
'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n")
1919
}
2020
end
2121
end
@@ -31,7 +31,7 @@
3131

3232
it {
3333
is_expected.to contain_file('/etc/httpd/conf.modules.d/lbmethod_byrequests.load').with('ensure' => 'file',
34-
'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n")
34+
'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n")
3535
}
3636
end
3737
end

spec/classes/mod/lbmethod_heartbeat.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
it {
1717
is_expected.to contain_file('/etc/apache2/mods-enabled/lbmethod_byrequests.load').with('ensure' => 'file',
18-
'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n")
18+
'content' => "LoadModule lbmethod_byrequests_module /usr/lib/apache2/modules/mod_lbmethod_byrequests.so\n")
1919
}
2020
end
2121
end
@@ -31,7 +31,7 @@
3131

3232
it {
3333
is_expected.to contain_file('/etc/httpd/conf.modules.d/lbmethod_byrequests.load').with('ensure' => 'file',
34-
'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n")
34+
'content' => "LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so\n")
3535
}
3636
end
3737
end

spec/classes/mod/prefork_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
it { is_expected.not_to contain_apache__mod('event') }
3030
it {
3131
is_expected.to contain_file('/etc/httpd/conf.modules.d/prefork.load').with('ensure' => 'file',
32-
'content' => "LoadModule mpm_prefork_module modules/mod_mpm_prefork.so\n")
32+
'content' => "LoadModule mpm_prefork_module modules/mod_mpm_prefork.so\n")
3333
}
3434
end
3535
context 'on a FreeBSD OS' do

spec/classes/mod/worker_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
it { is_expected.not_to contain_apache__mod('event') }
2727
it {
2828
is_expected.to contain_file('/etc/httpd/conf.modules.d/worker.load').with('ensure' => 'file',
29-
'content' => "LoadModule mpm_worker_module modules/mod_mpm_worker.so\n")
29+
'content' => "LoadModule mpm_worker_module modules/mod_mpm_worker.so\n")
3030
}
3131
end
3232
context 'on a FreeBSD OS' do

spec/classes/service_spec.rb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
it {
1414
is_expected.to contain_service('httpd').with(
15-
'name' => 'apache2',
16-
'ensure' => 'running',
17-
'enable' => 'true',
15+
'name' => 'apache2',
16+
'ensure' => 'running',
17+
'enable' => 'true',
1818
)
1919
}
2020

@@ -33,9 +33,9 @@
3333

3434
it {
3535
is_expected.to contain_service('httpd').with(
36-
'name' => 'apache2',
37-
'ensure' => 'running',
38-
'enable' => 'true',
36+
'name' => 'apache2',
37+
'ensure' => 'running',
38+
'enable' => 'true',
3939
)
4040
}
4141
end
@@ -45,9 +45,9 @@
4545

4646
it {
4747
is_expected.to contain_service('httpd').with(
48-
'name' => 'apache2',
49-
'ensure' => 'running',
50-
'enable' => 'false',
48+
'name' => 'apache2',
49+
'ensure' => 'running',
50+
'enable' => 'false',
5151
)
5252
}
5353
end
@@ -57,8 +57,8 @@
5757

5858
it {
5959
is_expected.to contain_service('httpd').with(
60-
'ensure' => 'running',
61-
'enable' => 'true',
60+
'ensure' => 'running',
61+
'enable' => 'true',
6262
)
6363
}
6464
end
@@ -68,8 +68,8 @@
6868

6969
it {
7070
is_expected.to contain_service('httpd').with(
71-
'ensure' => 'stopped',
72-
'enable' => 'true',
71+
'ensure' => 'stopped',
72+
'enable' => 'true',
7373
)
7474
}
7575
end
@@ -100,7 +100,7 @@
100100
let(:params) do
101101
{
102102
'service_ensure' => 'running',
103-
'service_name' => 'httpd',
103+
'service_name' => 'httpd',
104104
'service_manage' => false,
105105
}
106106
end
@@ -113,9 +113,9 @@
113113

114114
it {
115115
is_expected.to contain_service('httpd').with(
116-
'name' => 'apache24',
117-
'ensure' => 'running',
118-
'enable' => 'true',
116+
'name' => 'apache24',
117+
'ensure' => 'running',
118+
'enable' => 'true',
119119
)
120120
}
121121
end
@@ -125,9 +125,9 @@
125125

126126
it {
127127
is_expected.to contain_service('httpd').with(
128-
'name' => 'apache2',
129-
'ensure' => 'running',
130-
'enable' => 'true',
128+
'name' => 'apache2',
129+
'ensure' => 'running',
130+
'enable' => 'true',
131131
)
132132
}
133133
end

0 commit comments

Comments
 (0)