Skip to content

Commit bffef42

Browse files
authored
feat: obatain local-prefix via tool (#168)
1 parent 743ba8c commit bffef42

19 files changed

+188
-112
lines changed

.github/.testcoverage-local.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Config file for go-test-coverage running locally.
22

33
profile: cover.profile
4-
local-prefix: github.com/vladopajic/go-test-coverage/v2
54
threshold:
65
file: 100
76
total: 98

.github/workflows/action-test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ jobs:
9595
id: test-3
9696
with:
9797
profile: cover.out
98-
local-prefix: "github.com/vladopajic/go-test-coverage/v2"
9998
threshold-file: 0
10099
threshold-package: 0
101100
threshold-total: 0
@@ -108,7 +107,6 @@ jobs:
108107
continue-on-error: true
109108
with:
110109
profile: cover.out
111-
local-prefix: "github.com/vladopajic/go-test-coverage/v2"
112110
threshold-file: 0
113111
threshold-package: 0
114112
threshold-total: 100

.github/workflows/testdata/total100.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# This file is used for integration tests
22

33
profile: cover.out
4-
local-prefix: "github.com/vladopajic/go-test-coverage/v2"
54
threshold:
65
file: 0
76
package: 0

.github/workflows/testdata/zero.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# This file is used for integration tests
22

33
profile: cover.out
4-
local-prefix: "github.com/vladopajic/go-test-coverage/v2"
54
threshold:
65
file: 0
76
package: 0

.testcoverage.example.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
# of profile files, e.g., 'cover_unit.out,cover_integration.out'.
88
profile: cover.out
99

10-
# (optional; but recommended to set)
11-
# When specified reported file paths will not contain local prefix in the output.
12-
local-prefix: "github.com/org/project"
13-
1410
# Holds coverage thresholds percentages, values should be in range [0-100].
1511
threshold:
1612
# (optional; default 0)

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ Here’s an example [.testcoverage.yml](./.testcoverage.example.yml) configurati
9090
# of profile files, e.g., 'cover_unit.out,cover_integration.out'.
9191
profile: cover.out
9292

93-
# (optional; but recommended to set)
94-
# When specified reported file paths will not contain local prefix in the output.
95-
local-prefix: "github.com/org/project"
96-
9793
# Holds coverage thresholds percentages, values should be in range [0-100].
9894
threshold:
9995
# (optional; default 0)

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ inputs:
1515
required: false
1616
default: ""
1717
type: string
18-
local-prefix:
19-
description: When specified reported file paths will not contain local prefix in the output. Overrides value from configuration.
18+
# DEPRECATED
19+
local-prefix:
20+
description: DEPRECATED! not used anymore.
2021
required: false
2122
default: ""
2223
type: string
@@ -132,7 +133,6 @@ runs:
132133
- --config=${{ inputs.config || '''''' }}
133134
- --profile=${{ inputs.profile || '''''' }}
134135
- --github-action-output=true
135-
- --local-prefix=${{ inputs.local-prefix || '''''' }}
136136
- --threshold-file=${{ inputs.threshold-file }}
137137
- --threshold-package=${{ inputs.threshold-package }}
138138
- --threshold-total=${{ inputs.threshold-total }}

docs/badge.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Example:
2121
uses: vladopajic/go-test-coverage@v2
2222
with:
2323
profile: cover.out
24-
local-prefix: github.com/org/project
2524
threshold-total: 95
2625

2726
## when token is not specified (value '') this feature is turned off
@@ -67,7 +66,6 @@ Example:
6766
uses: vladopajic/go-test-coverage@v2
6867
with:
6968
profile: cover.out
70-
local-prefix: github.com/org/project
7169
threshold-total: 95
7270

7371
## when secret is not specified (value '') this feature is turned off.
@@ -94,7 +92,6 @@ Example:
9492
uses: vladopajic/go-test-coverage@v2
9593
with:
9694
profile: cover.out
97-
local-prefix: github.com/org/project
9895
threshold-total: 95
9996
10097
# badge will be generated and store on file system with `coverage.svg` name
@@ -113,7 +110,6 @@ Example:
113110
uses: vladopajic/go-test-coverage@v2
114111
with:
115112
profile: cover.out
116-
local-prefix: github.com/org/project
117113
threshold-total: 95
118114

119115
## in this case token should be from other repository that will host badges.

docs/github_action.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Alternatively, if you don't need advanced configuration options from a config fi
3131
uses: vladopajic/go-test-coverage@v2
3232
with:
3333
profile: cover.out
34-
local-prefix: github.com/org/project
3534
threshold-file: 80
3635
threshold-package: 80
3736
threshold-total: 95

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const (
2626
type args struct {
2727
ConfigPath string `arg:"-c,--config"`
2828
Profile string `arg:"-p,--profile" help:"path to coverage profile"`
29-
LocalPrefix string `arg:"-l,--local-prefix"`
29+
LocalPrefix string `arg:"-l,--local-prefix"` // deprecated
3030
GithubActionOutput bool `arg:"-o,--github-action-output"`
3131
ThresholdFile int `arg:"-f,--threshold-file"`
3232
ThresholdPackage int `arg:"-k,--threshold-package"`
@@ -99,7 +99,7 @@ func (a *args) overrideConfig(cfg testcoverage.Config) (testcoverage.Config, err
9999
}
100100

101101
if !isCIDefaultString(a.LocalPrefix) {
102-
cfg.LocalPrefix = a.LocalPrefix
102+
cfg.LocalPrefixDeprecated = a.LocalPrefix
103103
}
104104

105105
if !isCIDefaultInt(a.ThresholdFile) {

0 commit comments

Comments
 (0)