Skip to content

Commit

Permalink
Merge pull request #517 from codacy/add_codacy_reporter_options
Browse files Browse the repository at this point in the history
Add CODACY_REPORTER_OPTIONS to get.sh and document it
  • Loading branch information
heliocodacy authored Jan 15, 2025
2 parents 78da4d8 + 2a7aae3 commit 7f08687
Show file tree
Hide file tree
Showing 2 changed files with 18 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
13 changes: 11 additions & 2 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,22 @@ if [ -z "$run_command" ]
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 $*"
log "Running command: $run_command $* $EXTRA_ARGUMENTS"
eval "$run_command $* $EXTRA_ARGUMENTS"
else
eval "$run_command \"report\""
log "Running command: $run_command \"report\" $EXTRA_ARGUMENTS"
eval "$run_command \"report\" $EXTRA_ARGUMENTS"
fi

0 comments on commit 7f08687

Please sign in to comment.