Skip to content

Commit 3c82b66

Browse files
Add support for add_prefix (#14)
* Add support for add_prefix * Update hooks/command Co-authored-by: Sam Giffney <[email protected]> Co-authored-by: Sam Giffney <[email protected]>
1 parent c972894 commit 3c82b66

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ Example: `false`
184184
185185
Controls the name outputs files formatted by the codeclimate test reporter. Required to stop artifact names clashing when processing muiltple test suites.
186186
187+
### `add_prefix` (optional, default `<empty_string>`)
188+
189+
Controls the prefix to add to file paths in coverage payloads, to make them match the project's directory structure.
190+
191+
187192
### `CC_TEST_REPORTER_ID` (required)
188193
189194
The `CC_TEST_REPORTER_ID` environment variable must be configured.

hooks/command

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ format_file() {
2626
--input-type "${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_INPUT_TYPE}" \
2727
--prefix "${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_PREFIX}" \
2828
--output "${output_file}" \
29+
--add-prefix "${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_ADD_PREFIX}" \
2930
"$1"
3031
}
3132

@@ -73,6 +74,7 @@ debug=""
7374
format=${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_FORMAT:-true}
7475
formatted_file_prefix=${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_FILE_PREFIX:-"codeclimate"}
7576
report=${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_REPORT:-true}
77+
add_prefix=${BUILDKITE_PLUGIN_CODECLIMATE_TEST_REPORTER_ADD_PREFIX:-""}
7678

7779
install_reporter
7880
download_artifacts

plugin.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ configuration:
2222
type: boolean
2323
file_prefix:
2424
type: string
25+
add_prefix:
26+
type: string
2527
required: [artifact, input_type]

0 commit comments

Comments
 (0)