Skip to content

Commit c297644

Browse files
committed
Address reek and rubocop errors
1 parent 8bd00f5 commit c297644

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/skunk/cli/application.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
module Skunk
1212
module Cli
1313
# Knows how to execute command line commands
14+
# :reek:InstanceVariableAssumption
1415
class Application < RubyCritic::Cli::Application
1516
COVERAGE_FILE = "coverage/.resultset.json"
1617

@@ -24,6 +25,7 @@ def execute
2425
parsed_options = @options.parse.to_h
2526
reporter = Skunk::Cli::CommandFactory.create(parsed_options).execute
2627

28+
# :reek:NilCheck
2729
@parsed_options = @options.parse.to_h
2830
reporter = Skunk::Cli::CommandFactory.create(@parsed_options).execute
2931

@@ -41,12 +43,13 @@ def warn_coverage_info
4143
warn "warning: Having no coverage metrics will make your SkunkScore worse."
4244
end
4345

46+
# :reek:NilCheck
4447
def print(message)
4548
filename = @parsed_options[:output_filename]
4649
if filename.nil?
4750
$stdout.puts(message)
4851
else
49-
File.open(filename, "w") { |f| f.puts(message) }
52+
File.open(filename, "w") { |file| file.puts(message) }
5053
end
5154
end
5255
end

lib/skunk/cli/options/argv.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Options
99
# Extends RubyCritic::Cli::Options::Argv to parse a subset of the
1010
# parameters accepted by RubyCritic
1111
class Argv < RubyCritic::Cli::Options::Argv
12+
# :reek:Attribute
1213
attr_accessor :output_filename
1314

1415
def parse # rubocop:disable Metrics/MethodLength
@@ -36,7 +37,7 @@ def parse # rubocop:disable Metrics/MethodLength
3637
end
3738

3839
def to_h
39-
super.merge({ output_filename: output_filename })
40+
super.merge(output_filename: output_filename)
4041
end
4142
end
4243
end

test/lib/skunk/application_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
end
4747
end
4848

49-
_(File.read("tmp/generated_report.txt")).must_equal File.read("test/samples/console_output.txt")
49+
_(File.read("tmp/generated_report.txt"))
50+
.must_equal File.read("test/samples/console_output.txt")
5051
end
5152
end
5253
end

0 commit comments

Comments
 (0)