Skip to content

Commit

Permalink
rubocop: Fix commas
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Feb 21, 2023
1 parent b5ab79e commit db4ba3a
Show file tree
Hide file tree
Showing 13 changed files with 622 additions and 636 deletions.
12 changes: 12 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,15 @@ Style/HashSyntax:

Layout/FirstArrayElementIndentation:
Enabled: false

Style/TrailingCommaInHashLiteral:
Enabled: True
EnforcedStyleForMultiline: consistent_comma

Style/TrailingCommaInArrayLiteral:
Enabled: True
EnforcedStyleForMultiline: consistent_comma

Style/TrailingCommaInArguments:
Enabled: True
EnforcedStyleForMultiline: consistent_comma
28 changes: 1 addition & 27 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-02-21 19:04:49 UTC using RuboCop version 1.12.1.
# on 2023-02-21 19:07:42 UTC using RuboCop version 1.12.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -616,32 +616,6 @@ Style/StringLiterals:
- 'test/test_generator.rb'
- 'test/util/generator_helpers.rb'

# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArrayLiteral:
Exclude:
- 'spec/beaker-hostgenerator/generator_spec.rb'
- 'spec/spec_helper.rb'
- 'test/test_generator.rb'
- 'test/util/generator_helpers.rb'

# Offense count: 38
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'lib/beaker-hostgenerator/cli.rb'
- 'lib/beaker-hostgenerator/data.rb'
- 'lib/beaker-hostgenerator/hypervisor.rb'
- 'lib/beaker-hostgenerator/roles.rb'
- 'lib/beaker-hostgenerator/util.rb'
- 'spec/beaker-hostgenerator/generator_spec.rb'
- 'spec/helpers.rb'
- 'test/util/generator_helpers.rb'

# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: WordRegex.
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace :generate do
task :fixtures do
$LOAD_PATH.unshift(
File.join(Dir.pwd, 'lib'),
File.join(Dir.pwd, 'test')
File.join(Dir.pwd, 'test'),
)
require 'beaker-hostgenerator'
require 'util/generator_helpers'
Expand Down
26 changes: 13 additions & 13 deletions lib/beaker-hostgenerator/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,55 +74,55 @@ def initialize(argv = ARGV.dup)
opts.on('-l',
'--list',
'List beaker-hostgenerator supported platforms, roles, and hypervisors. ' <<
'Does not produce host config.') do
'Does not produce host config.',) do
@options[:list_supported_values] = true
end

opts.on('--templates-only',
'Generate a reduced output including only the templates from each host.') do
'Generate a reduced output including only the templates from each host.',) do
@options[:templates_only] = true
end

opts.on('-t',
'--hypervisor HYPERVISOR',
'Set beaker-hostgenerator default hypervisor. ') do |h|
'Set beaker-hostgenerator default hypervisor. ',) do |h|
@options[:hypervisor] = h
end

opts.on('--pe_upgrade_dir UPGRADE_PATH',
'Explicitly set pe_upgrade_dir attribute on generated hosts. ') do |p|
'Explicitly set pe_upgrade_dir attribute on generated hosts. ',) do |p|
@options[:pe_upgrade_dir] = p
end

opts.on('--pe_upgrade_ver UPGRADE_VERSION',
'Explicitly set pe_upgrade_ver attribute on generated hosts. ') do |p|
'Explicitly set pe_upgrade_ver attribute on generated hosts. ',) do |p|
@options[:pe_upgrade_ver] = p
end

opts.on('--pe_dir PATH',
'Explicitly set pe_dir attribute on generated hosts. ') do |p|
'Explicitly set pe_dir attribute on generated hosts. ',) do |p|
@options[:pe_dir] = p
end

opts.on('--pe_ver VERSION',
'Explicitly set pe_ver attribute on generated hosts. ') do |p|
'Explicitly set pe_ver attribute on generated hosts. ',) do |p|
@options[:pe_ver] = p
end

opts.on('--disable-role-config',
"Do not include role-specific configuration.") do
"Do not include role-specific configuration.",) do
@options[:disable_role_config] = true
end

opts.on('--disable-default-role',
"Do not include the default 'agent' role.") do
"Do not include the default 'agent' role.",) do
@options[:disable_default_role] = true
end

opts.on('--osinfo-version MAJOR_VERSION',
"Use OSINFO for specified beaker-hostgenerator version. " <<
"Allows early access to future version of OSINFO data structure " <<
"used to generate host configs.") do |version|
"used to generate host configs.",) do |version|
version = version.to_i
if not [0, 1].include? version
raise "Invalid beaker-hostgenerator version: #{version}"
Expand All @@ -133,19 +133,19 @@ def initialize(argv = ARGV.dup)

opts.on('--global-config KEYVALUE_STRING',
"General configuration settings to be included as-is in the " <<
"CONFIG section. Value should be in the form '{key=value,...}'.") do |p|
"CONFIG section. Value should be in the form '{key=value,...}'.",) do |p|
@options[:global_config] = p
end

opts.on('-h',
'--help',
'Display command help.') do
'Display command help.',) do
@options[:help] = opts.to_s
end

opts.on('-v',
'--version',
'Display beaker-hostgenerator version number.') do
'Display beaker-hostgenerator version number.',) do
@options[:version] = true
end
end
Expand Down
Loading

0 comments on commit db4ba3a

Please sign in to comment.