Skip to content

Commit 6413f31

Browse files
committed
Add CODACY_REPORTER_OPTIONS to get.sh and document it
1 parent 78da4d8 commit 6413f31

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

README.md

Lines changed: 7 additions & 1 deletion
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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,20 @@ then
232232
fatal "Codacy coverage reporter binary could not be found."
233233
fi
234234

235+
if [ -z "$CODACY_REPORTER_OPTIONS" ] && [ -n "$CODACY_REPORTER_OPTIONS" ]; then
236+
EXTRA_ARGUMENTS="$CODACY_REPORTER_OPTIONS"
237+
else
238+
EXTRA_ARGUMENTS=""
239+
fi
240+
241+
235242
if [ "$#" -eq 1 ] && [ "$1" = "download" ];
236243
then
237244
log "$g" "Codacy reporter download succeeded";
238245
elif [ "$#" -gt 0 ];
239246
then
240-
eval "$run_command $*"
247+
eval "$run_command $* $EXTRA_ARGUMENTS"
241248
else
242-
eval "$run_command \"report\""
249+
eval "$run_command \"report\" $EXTRA_ARGUMENTS"
243250
fi
251+

0 commit comments

Comments
 (0)