Skip to content

Commit

Permalink
Add support for add_prefix (#14)
Browse files Browse the repository at this point in the history
* Add support for add_prefix

* Update hooks/command

Co-authored-by: Sam Giffney <[email protected]>

Co-authored-by: Sam Giffney <[email protected]>
  • Loading branch information
curtiscook and s01ipsist authored Dec 14, 2022
1 parent c972894 commit 3c82b66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ Example: `false`
Controls the name outputs files formatted by the codeclimate test reporter. Required to stop artifact names clashing when processing muiltple test suites.
### `add_prefix` (optional, default `<empty_string>`)
Controls the prefix to add to file paths in coverage payloads, to make them match the project's directory structure.
### `CC_TEST_REPORTER_ID` (required)
The `CC_TEST_REPORTER_ID` environment variable must be configured.
Expand Down
2 changes: 2 additions & 0 deletions hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ format_file() {
--input-type "${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_INPUT_TYPE}" \
--prefix "${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_PREFIX}" \
--output "${output_file}" \
--add-prefix "${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_ADD_PREFIX}" \
"$1"
}

Expand Down Expand Up @@ -73,6 +74,7 @@ debug=""
format=${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_FORMAT:-true}
formatted_file_prefix=${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_FILE_PREFIX:-"codeclimate"}
report=${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_REPORT:-true}
add_prefix=${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_ADD_PREFIX:-""}

install_reporter
download_artifacts
Expand Down
2 changes: 2 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ configuration:
type: boolean
file_prefix:
type: string
add_prefix:
type: string
required: [artifact, input_type]

0 comments on commit 3c82b66

Please sign in to comment.