Skip to content

Commit

Permalink
Rubocop Autofix: Layout/LineContinuationSpacing: Use one space in fro…
Browse files Browse the repository at this point in the history
…nt of backslash
  • Loading branch information
danadoherty639 committed Feb 28, 2025
1 parent 0264bdc commit d7f0dcd
Show file tree
Hide file tree
Showing 52 changed files with 253 additions and 260 deletions.
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 253
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: space, no_space
Layout/LineContinuationSpacing:
Enabled: false

# Offense count: 25
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
Expand Down
2 changes: 1 addition & 1 deletion bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def run_task(targets, task, args = {}, options = {})
if unsupported_puppet?(result['clientversion'])
Bolt::Logger.deprecate(
"unsupported_puppet",
"Detected unsupported Puppet agent version #{result['clientversion']} on target "\
"Detected unsupported Puppet agent version #{result['clientversion']} on target " \
"#{result.target}. Bolt supports Puppet agent 6.0.0 and higher."
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def puppetdb_command_with_instance(command, version, payload, instance)
# Error if the PDB client does not implement :send_command
unless puppetdb_client.respond_to?(:send_command)
raise Bolt::Error.new(
"PuppetDB client #{puppetdb_client.class} does not implement :send_command, "\
"PuppetDB client #{puppetdb_client.class} does not implement :send_command, " \
"unable to invoke command.",
'bolt/pdb-command'
)
Expand Down
4 changes: 2 additions & 2 deletions bolt-modules/boltlib/lib/puppet/functions/run_container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def validate_options(options)
end

if (bad_vs = volumes.reject { |k, v| k.is_a?(String) && v.is_a?(String) }).any?
msg = "Option 'volumes' only accepts strings for keys and values. "\
msg = "Option 'volumes' only accepts strings for keys and values. " \
"Received: #{bad_vs.map(&:inspect).join(', ')}"
raise Bolt::ValidationError, msg
end
Expand All @@ -153,7 +153,7 @@ def validate_options(options)
end

if (bad_ps = ports.reject { |k, v| k.is_a?(Integer) && v.is_a?(Integer) }).any?
msg = "Option 'ports' only accepts integers for keys and values. "\
msg = "Option 'ports' only accepts integers for keys and values. " \
"Received: #{bad_ps.map(&:inspect).join(', ')}"
raise Bolt::ValidationError, msg
end
Expand Down
4 changes: 2 additions & 2 deletions bolt-modules/boltlib/lib/puppet/functions/set_resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def set_resources(target, resources)

unless resource.target == target
file, line = Puppet::Pops::PuppetStack.top_of_stack
raise Bolt::ValidationError, "Cannot set resource #{resource.reference} for target "\
"#{resource.target} on target #{target}. "\
raise Bolt::ValidationError, "Cannot set resource #{resource.reference} for target " \
"#{resource.target} on target #{target}. " \
"#{Puppet::Util::Errors.error_location(file, line)}"
end

Expand Down
2 changes: 1 addition & 1 deletion bolt-modules/boltlib/lib/puppet/functions/wait.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def inner_wait(futures: nil, timeout: nil, options: {})
valid, unknown = options.partition { |k, _v| %w[_catch_errors].include?(k) }.map(&:to_h)
if unknown.any?
file, line = Puppet::Pops::PuppetStack.top_of_stack
msg = "The wait() function call in #{file}#L#{line} received unknown options "\
msg = "The wait() function call in #{file}#L#{line} received unknown options " \
"#{unknown.keys}. Removing unknown options and continuing..."
Bolt::Logger.warn("plan_function_options", msg)
end
Expand Down
4 changes: 2 additions & 2 deletions bolt-modules/boltlib/spec/functions/run_container_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def image
end

let(:msg) {
"docker: Error response from daemon: OCI runtime create failed: "\
"container_linux.go:367: starting container process caused: exec: "\
"docker: Error response from daemon: OCI runtime create failed: " \
"container_linux.go:367: starting container process caused: exec: " \
"\"foo\": executable file not found in $PATH: unknown.\n"
}
let(:value) do
Expand Down
2 changes: 1 addition & 1 deletion lib/bolt/analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def self.config_path

if File.exist?(path)
if File.exist?(old_path)
message = "Detected analytics configuration files at '#{old_path}' and '#{path}'. Loading "\
message = "Detected analytics configuration files at '#{old_path}' and '#{path}'. Loading " \
"analytics configuration from '#{path}'."
Bolt::Logger.warn_once('duplicate_analytics', message)
end
Expand Down
26 changes: 13 additions & 13 deletions lib/bolt/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def apply(manifest, targets, code: '', noop: false)
if defined?(ast.body) &&
(ast.body.is_a?(Puppet::Pops::Model::HostClassDefinition) ||
ast.body.is_a?(Puppet::Pops::Model::ResourceTypeDefinition))
message = "Manifest only contains definitions and will result in no changes on the targets. "\
"Definitions must be declared for their resources to be applied. You can read more "\
"about defining and declaring classes and types in the Puppet documentation at "\
"https://puppet.com/docs/puppet/latest/lang_classes.html and "\
message = "Manifest only contains definitions and will result in no changes on the targets. " \
"Definitions must be declared for their resources to be applied. You can read more " \
"about defining and declaring classes and types in the Puppet documentation at " \
"https://puppet.com/docs/puppet/latest/lang_classes.html and " \
"https://puppet.com/docs/puppet/latest/lang_defined_types.html"
Bolt::Logger.warn("empty_manifest", message)
end
Expand Down Expand Up @@ -281,7 +281,7 @@ def install_modules(outputter, force: false, resolve: true)

if config.project.modules.empty? && resolve
outputter.print_message(
"Project configuration file #{config.project.project_file} does not "\
"Project configuration file #{config.project.project_file} does not " \
"specify any module dependencies. Nothing to do."
)
return true
Expand Down Expand Up @@ -439,8 +439,8 @@ def apply_policies(policies, targets, noop: false)

# CODEREVIEW: Phrasing
raise Bolt::Error.new(
"The following policies are not available to the project: '#{unavailable_policies.join("', '")}'. "\
"You must list policies in a project's 'policies' setting before Bolt can apply them to targets. "\
"The following policies are not available to the project: '#{unavailable_policies.join("', '")}'. " \
"You must list policies in a project's 'policies' setting before Bolt can apply them to targets. " \
"For a list of policies available to the project, run '#{command}'.",
'bolt/unavailable-policy-error'
)
Expand All @@ -460,7 +460,7 @@ def apply_policies(policies, targets, noop: false)
# CODEREVIEW: Phrasing
if unloadable_policies.any?
raise Bolt::Error.new(
"The following policies cannot be loaded: '#{unloadable_policies.join("', '")}'. "\
"The following policies cannot be loaded: '#{unloadable_policies.join("', '")}'. " \
"Policies must be a Puppet class saved to a project's or module's manifests directory.",
'bolt/unloadable-policy-error'
)
Expand Down Expand Up @@ -509,7 +509,7 @@ def new_policy(name)
# Error if name is not namespaced to project
unless prefix == @config.project.name
raise Bolt::ValidationError,
"Policy name '#{name}' must begin with project name '#{@config.project.name}'. Did "\
"Policy name '#{name}' must begin with project name '#{@config.project.name}'. Did " \
"you mean '#{@config.project.name}::#{name}'?"
end

Expand Down Expand Up @@ -578,9 +578,9 @@ def list_policies
command = Bolt::Util.powershell? ? 'New-BoltPolicy -Name <NAME>' : 'bolt policy new <NAME>'

raise Bolt::Error.new(
"Project configuration file #{@config.project.project_file} does not "\
"specify any policies. You can add policies to the project by including "\
"a 'policies' key or creating a new policy using the '#{command}' "\
"Project configuration file #{@config.project.project_file} does not " \
"specify any policies. You can add policies to the project by including " \
"a 'policies' key or creating a new policy using the '#{command}' " \
"command.",
'bolt/no-policies-error'
)
Expand Down Expand Up @@ -719,7 +719,7 @@ def list_tasks(filter: nil)
unless project.project_file?
command = Bolt::Util.powershell? ? 'New-BoltProject' : 'bolt project init'

msg = "Could not find project configuration file #{project.project_file}, unable "\
msg = "Could not find project configuration file #{project.project_file}, unable " \
"to install modules. To create a Bolt project, run '#{command}'."

raise Bolt::Error.new(msg, 'bolt/missing-project-config-error')
Expand Down
2 changes: 1 addition & 1 deletion lib/bolt/bolt_option_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ def initialize(options)
separator "\n#{self.class.colorize(:cyan, 'Display options')}"
define('--filter FILTER', 'Filter tasks and plans by a matching substring.') do |filter|
unless /^[a-z0-9_:]+$/.match(filter)
msg = "Illegal characters in filter string '#{filter}'. Filters can "\
msg = "Illegal characters in filter string '#{filter}'. Filters can " \
"only include lowercase letters, numbers, underscores, and colons."
raise Bolt::CLIError, msg
end
Expand Down
10 changes: 5 additions & 5 deletions lib/bolt/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ def parse
end

if options[:action] == 'apply' && options[:leftovers].any?
raise Bolt::CLIError, "Unknown argument(s) #{options[:leftovers].join(', ')}. "\
"To apply multiple policies, provide a comma-separated list of "\
raise Bolt::CLIError, "Unknown argument(s) #{options[:leftovers].join(', ')}. " \
"To apply multiple policies, provide a comma-separated list of " \
"policy names."
end

Expand All @@ -310,7 +310,7 @@ def parse

if options[:subcommand] == 'module' && options[:action] == 'install' && options[:object]
command = Bolt::Util.powershell? ? 'Add-BoltModule -Module' : 'bolt module add'
raise Bolt::CLIError, "Invalid argument '#{options[:object]}'. To add a new module to "\
raise Bolt::CLIError, "Invalid argument '#{options[:object]}'. To add a new module to " \
"the project, run '#{command} #{options[:object]}'."
end

Expand Down Expand Up @@ -880,7 +880,7 @@ def execute(options)
#
private def validate_ps_version
if Bolt::Util.powershell?
command = "powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy "\
command = "powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy " \
"Bypass -Command $PSVersionTable.PSVersion.Major"
stdout, _stderr, _status = Open3.capture3(command)

Expand Down Expand Up @@ -935,7 +935,7 @@ def execute(options)
private def with_signal_handling
handler = Signal.trap :INT do |signo|
Bolt::Logger.logger(self).info(
"Exiting after receiving SIG#{Signal.signame(signo)} signal. "\
"Exiting after receiving SIG#{Signal.signame(signo)} signal. " \
"There might be processes left executing on some targets."
)
exit!
Expand Down
12 changes: 6 additions & 6 deletions lib/bolt/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def self.load_bolt_defaults_yaml(dir)

Bolt::Logger.warn(
"unsupported_project_config",
"Unsupported project configuration detected in '#{filepath}': #{project_config.keys}. "\
"Unsupported project configuration detected in '#{filepath}': #{project_config.keys}. " \
"Project configuration should be set in 'bolt-project.yaml'."
)
end
Expand All @@ -114,8 +114,8 @@ def self.load_bolt_defaults_yaml(dir)

Bolt::Logger.warn(
"unsupported_inventory_config",
"Unsupported inventory configuration detected in '#{filepath}': #{transport_config.keys}. "\
"Transport configuration should be set under the 'inventory-config' option or "\
"Unsupported inventory configuration detected in '#{filepath}': #{transport_config.keys}. " \
"Transport configuration should be set under the 'inventory-config' option or " \
"in 'inventory.yaml'."
)
end
Expand All @@ -126,13 +126,13 @@ def self.load_bolt_defaults_yaml(dir)
if data.key?('inventory-config')
unless data['inventory-config'].is_a?(Hash)
raise Bolt::ValidationError,
"Option 'inventory-config' must be of type Hash, received #{data['inventory-config']} "\
"Option 'inventory-config' must be of type Hash, received #{data['inventory-config']} " \
"#{data['inventory-config']} (file: #{filepath})"
end

if data['inventory-config'].key?('_plugin')
raise Bolt::ValidationError,
"Found unsupported key '_plugin' for option 'inventory-config'; supported keys are "\
"Found unsupported key '_plugin' for option 'inventory-config'; supported keys are " \
"'#{INVENTORY_OPTIONS.keys.join("', '")}' (file: #{filepath})"
end

Expand Down Expand Up @@ -334,7 +334,7 @@ def deep_clone
def validate
if @data['modulepath']&.include?(@project.managed_moduledir.to_s)
raise Bolt::ValidationError,
"Found invalid path in modulepath: #{@project.managed_moduledir}. This path "\
"Found invalid path in modulepath: #{@project.managed_moduledir}. This path " \
"is automatically appended to the modulepath and cannot be configured."
end

Expand Down
Loading

0 comments on commit d7f0dcd

Please sign in to comment.