Skip to content

Commit ccf9f43

Browse files
committed
Fix Rubocop cop name warnings
1 parent 7765215 commit ccf9f43

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/dry/cli/banner.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def self.arguments(command)
8686
required_arguments = command.required_arguments
8787
optional_arguments = command.optional_arguments
8888

89-
required = required_arguments.map { |arg| arg.name.upcase }.join(" ") if required_arguments.any? # rubocop:disable Metrics/LineLength
90-
optional = optional_arguments.map { |arg| "[#{arg.name.upcase}]" }.join(" ") if optional_arguments.any? # rubocop:disable Metrics/LineLength
89+
required = required_arguments.map { |arg| arg.name.upcase }.join(" ") if required_arguments.any? # rubocop:disable Layout/LineLength
90+
optional = optional_arguments.map { |arg| "[#{arg.name.upcase}]" }.join(" ") if optional_arguments.any? # rubocop:disable Layout/LineLength
9191
result = [required, optional].compact
9292

9393
" #{result.join(" ")}" unless result.empty?
@@ -97,7 +97,7 @@ def self.arguments(command)
9797
# @api private
9898
def self.extended_command_arguments(command)
9999
command.arguments.map do |argument|
100-
" #{argument.name.to_s.upcase.ljust(32)} # #{"REQUIRED " if argument.required?}#{argument.desc}" # rubocop:disable Metrics/LineLength
100+
" #{argument.name.to_s.upcase.ljust(32)} # #{"REQUIRED " if argument.required?}#{argument.desc}" # rubocop:disable Layout/LineLength
101101
end.join("\n")
102102
end
103103

lib/dry/cli/parser.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def self.call(command, arguments, prog_name)
3232
parsed_options = command.default_params.merge(parsed_options)
3333
parse_required_params(command, arguments, prog_name, parsed_options)
3434
rescue ::OptionParser::ParseError
35-
Result.failure("ERROR: \"#{prog_name}\" was called with arguments \"#{original_arguments.join(" ")}\"") # rubocop:disable Metrics/LineLength
35+
Result.failure("ERROR: \"#{prog_name}\" was called with arguments \"#{original_arguments.join(" ")}\"") # rubocop:disable Layout/LineLength
3636
end
3737

3838
# @since 0.1.0
@@ -42,14 +42,14 @@ def self.call(command, arguments, prog_name)
4242
def self.parse_required_params(command, arguments, prog_name, parsed_options)
4343
parsed_params = match_arguments(command.arguments, arguments)
4444
parsed_required_params = match_arguments(command.required_arguments, arguments)
45-
all_required_params_satisfied = command.required_arguments.all? { |param| !parsed_required_params[param.name].nil? } # rubocop:disable Metrics/LineLength
45+
all_required_params_satisfied = command.required_arguments.all? { |param| !parsed_required_params[param.name].nil? } # rubocop:disable Layout/LineLength
4646

4747
unused_arguments = arguments.drop(command.required_arguments.length)
4848

4949
unless all_required_params_satisfied
5050
parsed_required_params_values = parsed_required_params.values.compact
5151

52-
usage = "\nUsage: \"#{prog_name} #{command.required_arguments.map(&:description_name).join(" ")}" # rubocop:disable Metrics/LineLength
52+
usage = "\nUsage: \"#{prog_name} #{command.required_arguments.map(&:description_name).join(" ")}" # rubocop:disable Layout/LineLength
5353

5454
usage += " | #{prog_name} SUBCOMMAND" if command.subcommands.any?
5555

@@ -58,7 +58,7 @@ def self.parse_required_params(command, arguments, prog_name, parsed_options)
5858
if parsed_required_params_values.empty?
5959
return Result.failure("ERROR: \"#{prog_name}\" was called with no arguments#{usage}")
6060
else
61-
return Result.failure("ERROR: \"#{prog_name}\" was called with arguments #{parsed_required_params_values}#{usage}") # rubocop:disable Metrics/LineLength
61+
return Result.failure("ERROR: \"#{prog_name}\" was called with arguments #{parsed_required_params_values}#{usage}") # rubocop:disable Layout/LineLength
6262
end
6363
end
6464

lib/dry/cli/usage.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def self.arguments(command)
5555
required_arguments = command.required_arguments
5656
optional_arguments = command.optional_arguments
5757

58-
required = required_arguments.map { |arg| arg.name.upcase }.join(" ") if required_arguments.any? # rubocop:disable Metrics/LineLength
59-
optional = optional_arguments.map { |arg| "[#{arg.name.upcase}]" }.join(" ") if optional_arguments.any? # rubocop:disable Metrics/LineLength
58+
required = required_arguments.map { |arg| arg.name.upcase }.join(" ") if required_arguments.any? # rubocop:disable Layout/LineLength
59+
optional = optional_arguments.map { |arg| "[#{arg.name.upcase}]" }.join(" ") if optional_arguments.any? # rubocop:disable Layout/LineLength
6060
result = [required, optional].compact
6161

6262
" #{result.join(" ")}" unless result.empty?

0 commit comments

Comments
 (0)