File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
lib/code_climate/test_reporter Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def format(result)
19
19
20
20
payload = to_payload ( result )
21
21
PayloadValidator . validate ( payload )
22
- if tddium? || ENV [ "TO_FILE" ]
22
+ if write_to_file?
23
23
file_path = File . join ( Dir . tmpdir , "codeclimate-test-coverage-#{ SecureRandom . uuid } .json" )
24
24
print "Coverage results saved to #{ file_path } ... "
25
25
File . open ( file_path , "w" ) { |file | file . write ( payload . to_json ) }
@@ -36,6 +36,8 @@ def format(result)
36
36
false
37
37
end
38
38
39
+ private
40
+
39
41
def partial?
40
42
tddium?
41
43
end
@@ -81,7 +83,6 @@ def to_payload(result)
81
83
}
82
84
end
83
85
84
-
85
86
def short_filename ( filename )
86
87
return filename unless ::SimpleCov . root
87
88
filename = filename . gsub ( ::SimpleCov . root , '.' ) . gsub ( /^\. \/ / , '' )
@@ -98,7 +99,13 @@ def round(numeric, precision)
98
99
Float ( numeric ) . round ( precision )
99
100
end
100
101
101
- private
102
+ def write_to_file?
103
+ return true if tddium? || ENV [ "CODECLIMATE_TO_FILE" ]
104
+ if ENV [ "TO_FILE" ]
105
+ warn "TO_FILE is deprecated, use CODECLIMATE_TO_FILE"
106
+ true
107
+ end
108
+ end
102
109
103
110
def apply_prefix filename
104
111
prefix = CodeClimate ::TestReporter . configuration . path_prefix
You can’t perform that action at this time.
0 commit comments