Skip to content

Commit

Permalink
Add CODACY_REPORTER_OPTIONS to get.sh and document it
Browse files Browse the repository at this point in the history
  • Loading branch information
heliocodacy committed Jan 15, 2025
1 parent 78da4d8 commit 6413f31
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,20 @@ Usage: codacy-coverage-reporter report
--coverage-reports | -r <your project coverage file name (supports globs)>
--partial <if the report is partial>
--prefix <the project path prefix>
--skip-ssl-verification` [default: false] - Skip the SSL certificate verification when communicating with the Codacy API
--skip-ssl-verification [default: false] - Skip the SSL certificate verification when communicating with the Codacy API
--force-coverage-parser <your coverage parser>
Available parsers are: opencover,clover,lcov,phpunit,jacoco,dotcover,cobertura,go
--> Succeeded!
```

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.

```
CODACY_REPORTER_OPTIONS="--skip-ssl-verification true"
```

## What is Codacy?

[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.
Expand Down
12 changes: 10 additions & 2 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,20 @@ then
fatal "Codacy coverage reporter binary could not be found."
fi

if [ -z "$CODACY_REPORTER_OPTIONS" ] && [ -n "$CODACY_REPORTER_OPTIONS" ]; then
EXTRA_ARGUMENTS="$CODACY_REPORTER_OPTIONS"
else
EXTRA_ARGUMENTS=""
fi


if [ "$#" -eq 1 ] && [ "$1" = "download" ];
then
log "$g" "Codacy reporter download succeeded";
elif [ "$#" -gt 0 ];
then
eval "$run_command $*"
eval "$run_command $* $EXTRA_ARGUMENTS"
else
eval "$run_command \"report\""
eval "$run_command \"report\" $EXTRA_ARGUMENTS"
fi

0 comments on commit 6413f31

Please sign in to comment.