Skip to content

Commit 357b04d

Browse files
author
jordanbreen28
committed
(CONT-793) - Final tweaks
1 parent cb4cf6d commit 357b04d

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

.rubocop_todo.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2023-04-21 14:47:05 UTC using RuboCop version 1.48.1.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
19
# Offense count: 1
210
# This cop supports unsafe autocorrection (--autocorrect-all).
311
Lint/OrAssignmentToConstant:
@@ -13,17 +21,17 @@ Metrics/AbcSize:
1321
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
1422
# AllowedMethods: refine
1523
Metrics/BlockLength:
16-
Max: 90
24+
Max: 83
1725

1826
# Offense count: 2
1927
# Configuration parameters: AllowedMethods, AllowedPatterns.
2028
Metrics/CyclomaticComplexity:
2129
Max: 9
2230

23-
# Offense count: 5
31+
# Offense count: 4
2432
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
2533
Metrics/MethodLength:
26-
Max: 17
34+
Max: 14
2735

2836
# Offense count: 2
2937
# Configuration parameters: AllowedMethods, AllowedPatterns.
@@ -62,7 +70,7 @@ RSpec/DescribeClass:
6270
# Offense count: 6
6371
# Configuration parameters: CountAsOne.
6472
RSpec/ExampleLength:
65-
Max: 25
73+
Max: 26
6674

6775
# Offense count: 15
6876
# Configuration parameters: .
@@ -106,8 +114,26 @@ RSpec/SubjectStub:
106114
- 'spec/unit/provider/exec/powershell_spec.rb'
107115
- 'spec/unit/provider/exec/pwsh_spec.rb'
108116

117+
# Offense count: 2
118+
# This cop supports safe autocorrection (--autocorrect).
119+
# Configuration parameters: EnforcedStyle.
120+
# SupportedStyles: prefer_alias, prefer_alias_method
109121
Style/Alias:
110-
Enabled: false
122+
Exclude:
123+
- 'spec/unit/provider/exec/powershell_spec.rb'
124+
- 'spec/unit/provider/exec/pwsh_spec.rb'
111125

126+
# Offense count: 2
127+
# Configuration parameters: AllowedMethods.
128+
# AllowedMethods: respond_to_missing?
112129
Style/OptionalBooleanParameter:
113-
Enabled: false
130+
Exclude:
131+
- 'lib/puppet/provider/exec/powershell.rb'
132+
- 'lib/puppet/provider/exec/pwsh.rb'
133+
134+
# Offense count: 9
135+
# This cop supports safe autocorrection (--autocorrect).
136+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
137+
# URISchemes: http, https
138+
Layout/LineLength:
139+
Max: 203

lib/puppet/provider/exec/pwsh.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ def run(command, check = false)
3232
# we redirect powershell's stdin to read from the file. Current
3333
# versions of Windows use per-user temp directories with strong
3434
# permissions, but I'd rather not make (poor) assumptions.
35-
if Puppet::Util::Platform.windows?
36-
return super("cmd.exe /c \"\"#{native_path(@pwsh)}\" #{pwsh_args.join(' ')} -Command - < \"#{native_path}\"\"", check)
37-
end
35+
return super("cmd.exe /c \"\"#{native_path(@pwsh)}\" #{pwsh_args.join(' ')} -Command - < \"#{native_path}\"\"", check) if Puppet::Util::Platform.windows?
3836

3937
return super("/bin/sh -c \"#{native_path(@pwsh)} #{pwsh_args.join(' ')} -Command - < #{native_path}\"", check)
4038
end

spec/spec_helper_acceptance_local.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ def remove_pwshlib
6262
uninstall_command = 'puppet module uninstall puppetlabs/pwshlib --force'
6363
uninstall_command += " --modulepath #{relative_folder('fixtures/modules').path}" if ENV['TARGET_HOST'] == 'localhost'
6464
Helper.instance.run_shell(uninstall_command, expect_failures: true) do |result|
65-
unless result.stderr.include?("Module 'puppetlabs-pwshlib' is not installed") || result.exit_code == 0
66-
raise 'Failed to uninstall puppetlabs/pwshlib'
67-
end
65+
raise 'Failed to uninstall puppetlabs/pwshlib' unless result.stderr.include?("Module 'puppetlabs-pwshlib' is not installed") || result.exit_code == 0
6866
end
6967
end
7068

0 commit comments

Comments
 (0)