Skip to content

Commit 7f08687

Browse files
authored
Merge pull request #517 from codacy/add_codacy_reporter_options
Add CODACY_REPORTER_OPTIONS to get.sh and document it
2 parents 78da4d8 + 2a7aae3 commit 7f08687

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,20 @@ Usage: codacy-coverage-reporter report
4343
--coverage-reports | -r <your project coverage file name (supports globs)>
4444
--partial <if the report is partial>
4545
--prefix <the project path prefix>
46-
--skip-ssl-verification` [default: false] - Skip the SSL certificate verification when communicating with the Codacy API
46+
--skip-ssl-verification [default: false] - Skip the SSL certificate verification when communicating with the Codacy API
4747
--force-coverage-parser <your coverage parser>
4848
Available parsers are: opencover,clover,lcov,phpunit,jacoco,dotcover,cobertura,go
4949
5050
5151
--> Succeeded!
5252
```
5353

54+
Codacy Coverage Reporter can be run with the `CODACY_REPORTER_OPTIONS` environment variable. This is useful for passing options to the reporter without having to modify the script.
55+
56+
```
57+
CODACY_REPORTER_OPTIONS="--skip-ssl-verification true"
58+
```
59+
5460
## What is Codacy?
5561

5662
[Codacy](https://www.codacy.com/) is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews.

get.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,22 @@ if [ -z "$run_command" ]
231231
then
232232
fatal "Codacy coverage reporter binary could not be found."
233233
fi
234+
if [ -z "$CODACY_REPORTER_OPTIONS" ] || [ -n "$CODACY_REPORTER_OPTIONS" ]; then
235+
EXTRA_ARGUMENTS="$CODACY_REPORTER_OPTIONS"
236+
else
237+
EXTRA_ARGUMENTS=""
238+
fi
239+
234240

235241
if [ "$#" -eq 1 ] && [ "$1" = "download" ];
236242
then
237243
log "$g" "Codacy reporter download succeeded";
238244
elif [ "$#" -gt 0 ];
239245
then
240-
eval "$run_command $*"
246+
log "Running command: $run_command $* $EXTRA_ARGUMENTS"
247+
eval "$run_command $* $EXTRA_ARGUMENTS"
241248
else
242-
eval "$run_command \"report\""
249+
log "Running command: $run_command \"report\" $EXTRA_ARGUMENTS"
250+
eval "$run_command \"report\" $EXTRA_ARGUMENTS"
243251
fi
252+

0 commit comments

Comments
 (0)