Skip to content

Commit 54db10d

Browse files
committed
(maint) Fix rubocop errors
Took the safest route and disabled cops either globally in .rubocop.yml for just for specific cases in lib/
1 parent a3dcc2e commit 54db10d

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

.rubocop.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ AllCops:
2020
- "**/Guardfile"
2121
Layout/LineLength:
2222
Description: People have wide screens, use them.
23-
Max: 200
23+
Enabled: false
2424
RSpec/BeforeAfterAll:
2525
Description: Beware of using after(:all) as it may cause state to leak between tests.
2626
A necessary evil in acceptance testing.
@@ -71,8 +71,6 @@ Style/TrailingCommaInArrayLiteral:
7171
Style/SymbolArray:
7272
Description: Using percent style obscures symbolic intent of array's contents.
7373
EnforcedStyle: brackets
74-
Metrics/LineLength:
75-
Max: 260
7674
RSpec/NamedSubject:
7775
Enabled: false
7876
RSpec/MessageSpies:
@@ -137,6 +135,8 @@ Layout/EmptyLineAfterGuardClause:
137135
Enabled: false
138136
Layout/EmptyLinesAroundArguments:
139137
Enabled: false
138+
Layout/EmptyLinesAroundBlockBody:
139+
Enabled: false
140140
Layout/EmptyLinesAroundAttributeAccessor:
141141
Enabled: false
142142
Layout/EndOfLine:
@@ -285,6 +285,8 @@ Performance/DeleteSuffix:
285285
Enabled: false
286286
Performance/InefficientHashSearch:
287287
Enabled: false
288+
Performance/RegexpMatch:
289+
Enabled: false
288290
Performance/UnfreezeString:
289291
Enabled: false
290292
Performance/UriDefaultParser:
@@ -315,6 +317,8 @@ RSpec/ExampleLength:
315317
Enabled: false
316318
RSpec/ExampleWithoutDescription:
317319
Enabled: false
320+
RSpec/ExampleWording:
321+
Enabled: false
318322
RSpec/ExpectChange:
319323
Enabled: false
320324
RSpec/ExpectInHook:
@@ -363,6 +367,8 @@ RSpec/SharedExamples:
363367
Enabled: false
364368
RSpec/StubbedMock:
365369
Enabled: false
370+
RSpec/SubjectStub:
371+
Enabled: false
366372
RSpec/UnspecifiedException:
367373
Enabled: false
368374
RSpec/VariableDefinition:
@@ -457,12 +463,16 @@ Style/RedundantRegexpCharacterClass:
457463
Enabled: false
458464
Style/RedundantRegexpEscape:
459465
Enabled: false
466+
Style/RedundantReturn:
467+
Enabled: false
460468
Style/RedundantSelfAssignment:
461469
Enabled: false
462470
Style/RedundantSort:
463471
Enabled: false
464472
Style/RescueStandardError:
465473
Enabled: false
474+
Style/SafeNavigation:
475+
Enabled: false
466476
Style/SingleArgumentDig:
467477
Enabled: false
468478
Style/SlicingWithRange:

lib/puppet/provider/cron/crontab.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def self.prefetch_hook(records)
207207
envs << record[:line]
208208
record[:skip] = true
209209
end
210-
when :blank # rubocop: disable Lint/EmptyWhen
210+
when :blank
211211
# nothing
212212
else
213213
if name

lib/puppet/provider/cron/filetype.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def newfiletype(name, &block)
2626
# implementation in the future. This way, we can refactor all three of
2727
# our cron file types into a common crontab file type.
2828
newfiletype(:crontab) do
29-
def initialize(user)
29+
def initialize(user) # rubocop:disable Lint/MissingSuper
3030
self.path = user
3131
end
3232

lib/puppet/type/cron.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def should_to_s(value = @should)
118118
end
119119
end
120120

121-
def is_to_s(value = @is) # rubocop: disable Style/PredicateName
121+
def is_to_s(value = @is) # rubocop: disable Naming/PredicateName
122122
if value
123123
if value.is_a?(Array) && (name == :command || value[0].is_a?(Symbol))
124124
value = value[0]

spec/lib/puppet_spec/files.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def self.cleanup
1212
begin
1313
allow(Dir).to receive(:entries).and_call_original
1414
FileUtils.rm_rf path, secure: true
15-
rescue Errno::ENOENT # rubocop:disable Lint/HandleExceptions
15+
rescue Errno::ENOENT
1616
# nothing to do
1717
end
1818
end

0 commit comments

Comments
 (0)