File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 11
11
module Skunk
12
12
module Cli
13
13
# Knows how to execute command line commands
14
+ # :reek:InstanceVariableAssumption
14
15
class Application < RubyCritic ::Cli ::Application
15
16
COVERAGE_FILE = "coverage/.resultset.json"
16
17
@@ -24,6 +25,7 @@ def execute
24
25
parsed_options = @options . parse . to_h
25
26
reporter = Skunk ::Cli ::CommandFactory . create ( parsed_options ) . execute
26
27
28
+ # :reek:NilCheck
27
29
@parsed_options = @options . parse . to_h
28
30
reporter = Skunk ::Cli ::CommandFactory . create ( @parsed_options ) . execute
29
31
@@ -41,12 +43,13 @@ def warn_coverage_info
41
43
warn "warning: Having no coverage metrics will make your SkunkScore worse."
42
44
end
43
45
46
+ # :reek:NilCheck
44
47
def print ( message )
45
48
filename = @parsed_options [ :output_filename ]
46
49
if filename . nil?
47
50
$stdout. puts ( message )
48
51
else
49
- File . open ( filename , "w" ) { |f | f . puts ( message ) }
52
+ File . open ( filename , "w" ) { |file | file . puts ( message ) }
50
53
end
51
54
end
52
55
end
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class Options
9
9
# Extends RubyCritic::Cli::Options::Argv to parse a subset of the
10
10
# parameters accepted by RubyCritic
11
11
class Argv < RubyCritic ::Cli ::Options ::Argv
12
+ # :reek:Attribute
12
13
attr_accessor :output_filename
13
14
14
15
def parse # rubocop:disable Metrics/MethodLength
@@ -36,7 +37,7 @@ def parse # rubocop:disable Metrics/MethodLength
36
37
end
37
38
38
39
def to_h
39
- super . merge ( { output_filename : output_filename } )
40
+ super . merge ( output_filename : output_filename )
40
41
end
41
42
end
42
43
end
Original file line number Diff line number Diff line change 46
46
end
47
47
end
48
48
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" )
50
51
end
51
52
end
52
53
end
You can’t perform that action at this time.
0 commit comments