This repository was archived by the owner on Feb 19, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
1414 gem . test_files = gem . files . grep ( %r{^(test|spec|features)/} )
1515 gem . name = "codacy-coverage"
1616 gem . require_paths = [ "lib" ]
17- gem . version = '0.0.1 '
17+ gem . version = '0.1.0 '
1818
1919 gem . required_ruby_version = '>= 1.8.7'
2020
Original file line number Diff line number Diff line change @@ -2,15 +2,23 @@ module Codacy
22 class Formatter
33
44 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
711 rescue => ex
812 logger . fatal ( ex )
913 false
1014 end
1115
1216 private
1317
18+ def should_run?
19+ ENV [ "CI" ] || ENV [ "JENKINS_URL" ] || ENV [ 'TDDIUM' ] || ENV [ "CODACY_RUN_LOCAL" ]
20+ end
21+
1422 def logger
1523 Codacy ::Configuration . logger
1624 end
Original file line number Diff line number Diff line change 22
33class InceptionFormatter
44 def format ( result )
5+ ENV [ "CODACY_RUN_LOCAL" ] = 'true'
56 Codacy ::Formatter . new . format ( result )
67 end
78end
You can’t perform that action at this time.
0 commit comments