Skip to content

Commit

Permalink
Rubocop: Enable Naming/VariableNumber
Browse files Browse the repository at this point in the history
I would like to clean up our .rubocop.yaml to follow our standards. I
think enabling this cop makes sense, except for the
`determine_if_x86_64` method. rubocop prefers `determine_if_x8664` but
since `x86_64` is it's own name I disable the cop for this function.
  • Loading branch information
bastelfreak committed May 11, 2024
1 parent f4a4b77 commit f687422
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ Naming/MethodParameterName:
Naming/PredicateName:
Enabled: false

Naming/VariableNumber:
Enabled: false

RSpec/DescribeClass:
Exclude:
- acceptance/fixtures/module/spec/**/*.rb
Expand Down
12 changes: 6 additions & 6 deletions acceptance/fixtures/module/spec/acceptance/demo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
end

it "is able to apply manifests" do
manifest_1 = "user {'foo':
manifest1 = "user {'foo':
ensure => present,}"
manifest_2 = "user {'foo':
manifest2 = "user {'foo':
ensure => absent,}"
manifest_3 = "user {'root':
manifest3 = "user {'root':
ensure => present,}"
apply_manifest(manifest_1, :expect_changes => true)
apply_manifest(manifest_2, :expect_changes => true)
apply_manifest(manifest_3)
apply_manifest(manifest1, :expect_changes => true)
apply_manifest(manifest2, :expect_changes => true)
apply_manifest(manifest3)
end

describe service('sshd') do
Expand Down
2 changes: 1 addition & 1 deletion lib/beaker/host/mac/pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def upgrade_package(name, _cmdline_args = '')

# Examine the host system to determine the architecture
# @return [Boolean] true if x86_64, false otherwise
def determine_if_x86_64
def determine_if_x86_64 # rubocop:disable Naming/VariableNumber
result = exec(Beaker::Command.new("uname -a | grep x86_64"), :expect_all_exit_codes => true)
result.exit_code == 0
end
Expand Down
2 changes: 1 addition & 1 deletion lib/beaker/host/pswindows/pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def uninstall_package(_name, _cmdline_args = '')

# Examine the host system to determine the architecture, overrides default host determine_if_x86_64 so that wmic is used
# @return [Boolean] true if x86_64, false otherwise
def determine_if_x86_64
def determine_if_x86_64 # rubocop:disable Naming/VariableNumber
identify_windows_architecture.include?('64')
end

Expand Down
2 changes: 1 addition & 1 deletion lib/beaker/host/unix/pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def upgrade_package(name, cmdline_args = '', opts = {})

# Examine the host system to determine the architecture
# @return [Boolean] true if x86_64, false otherwise
def determine_if_x86_64
def determine_if_x86_64 # rubocop:disable Naming/VariableNumber
if self[:platform].include?('solaris')
result = exec(Beaker::Command.new("uname -a | grep x86_64"), :accept_all_exit_codes => true)
result.exit_code == 0
Expand Down
2 changes: 1 addition & 1 deletion lib/beaker/host/windows/pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def uninstall_package(name, _cmdline_args = '')

# Examine the host system to determine the architecture, overrides default host determine_if_x86_64 so that wmic is used
# @return [Boolean] true if x86_64, false otherwise
def determine_if_x86_64
def determine_if_x86_64 # rubocop:disable Naming/VariableNumber
identify_windows_architecture.include?('64')
end

Expand Down

0 comments on commit f687422

Please sign in to comment.