This repository was archived by the owner on Feb 19, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
gem . test_files = gem . files . grep ( %r{^(test|spec|features)/} )
15
15
gem . name = "codacy-coverage"
16
16
gem . require_paths = [ "lib" ]
17
- gem . version = '0.0.1 '
17
+ gem . version = '0.1.0 '
18
18
19
19
gem . required_ruby_version = '>= 1.8.7'
20
20
Original file line number Diff line number Diff line change @@ -2,15 +2,23 @@ module Codacy
2
2
class Formatter
3
3
4
4
def format ( result )
5
- parse_result = Codacy ::Parser . parse_file ( result )
6
- Codacy ::ClientAPI . post_results ( parse_result )
5
+ if should_run?
6
+ parse_result = Codacy ::Parser . parse_file ( result )
7
+ Codacy ::ClientAPI . post_results ( parse_result )
8
+ else
9
+ logger . info ( "Running locally, skipping Codacy coverage" )
10
+ end
7
11
rescue => ex
8
12
logger . fatal ( ex )
9
13
false
10
14
end
11
15
12
16
private
13
17
18
+ def should_run?
19
+ ENV [ "CI" ] || ENV [ "JENKINS_URL" ] || ENV [ 'TDDIUM' ] || ENV [ "CODACY_RUN_LOCAL" ]
20
+ end
21
+
14
22
def logger
15
23
Codacy ::Configuration . logger
16
24
end
Original file line number Diff line number Diff line change 2
2
3
3
class InceptionFormatter
4
4
def format ( result )
5
+ ENV [ "CODACY_RUN_LOCAL" ] = 'true'
5
6
Codacy ::Formatter . new . format ( result )
6
7
end
7
8
end
You can’t perform that action at this time.
0 commit comments