Skip to content

Commit afe25c2

Browse files
committed
RuboCop: resolve Lint/UselessAssignment
1 parent 92f7ef6 commit afe25c2

File tree

5 files changed

+5
-16
lines changed

5 files changed

+5
-16
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,6 @@ Lint/UselessAccessModifier:
110110
- 'lib/stack_master/parameter_loader.rb'
111111
- 'lib/stack_master/template_compilers/sparkle_formation.rb'
112112

113-
# This cop supports safe autocorrection (--autocorrect).
114-
Lint/UselessAssignment:
115-
Exclude:
116-
- 'lib/stack_master/cli.rb'
117-
- 'lib/stack_master/commands/tidy.rb'
118-
- 'lib/stack_master/parameter_resolvers/latest_ami_by_tags.rb'
119-
- 'lib/stack_master/template_compiler.rb'
120-
121113
# This cop supports safe autocorrection (--autocorrect).
122114
# Configuration parameters: CheckForMethodsWithNoSideEffects.
123115
Lint/Void:

lib/stack_master/cli.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def default_config_file
263263
def load_config(file)
264264
stack_file = file || default_config_file
265265
StackMaster::Config.load!(stack_file)
266-
rescue Errno::ENOENT => e
266+
rescue Errno::ENOENT
267267
say "Failed to load config file #{stack_file}"
268268
@kernel.exit false
269269
end
@@ -301,7 +301,7 @@ def execute_stacks_command(command, args, options)
301301
end
302302

303303
def show_other_region_candidates(config, stack_name)
304-
candidates = config.filter(region = '', stack_name = stack_name)
304+
candidates = config.filter('', stack_name = stack_name)
305305
return if candidates.empty?
306306

307307
StackMaster.stdout.puts "Stack name #{stack_name} exists in regions: #{candidates.map(&:region).join(', ')}"

lib/stack_master/commands/tidy.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ class Tidy
55
include StackMaster::Commands::TerminalHelper
66

77
def perform
8-
used_templates = []
9-
used_parameter_files = []
10-
118
templates = Set.new(find_templates)
129
parameter_files = Set.new(find_parameter_files)
1310

14-
status = @config.stacks.each do |stack_definition|
11+
@config.stacks.each do |stack_definition|
1512
parameter_files.subtract(stack_definition.parameter_files_from_globs)
1613
template = File.absolute_path(stack_definition.template_file_path)
1714

lib/stack_master/parameter_resolvers/latest_ami_by_tags.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def initialize(config, stack_definition)
1010
end
1111

1212
def resolve(value)
13-
filters = @ami_finder.build_filters_from_string(value, prefix = 'tag')
13+
filters = @ami_finder.build_filters_from_string(value, 'tag')
1414
@ami_finder.find_latest_ami(filters)&.image_id
1515
end
1616
end

lib/stack_master/template_compiler.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def self.compile(config, template_compiler, template_dir, template, compile_time
1010
end
1111
compiler.require_dependencies
1212
compiler.compile(template_dir, template, compile_time_parameters, compiler_options)
13-
rescue StandardError => e
13+
rescue StandardError
1414
raise TemplateCompilationFailed, "Failed to compile #{template}"
1515
end
1616

0 commit comments

Comments
 (0)