Skip to content

Commit 63a6d19

Browse files
committed
SE-0501: Update proposal base on review
Update the SE-0501 proposal based on feedback from the review
1 parent 85fb937 commit 63a6d19

File tree

1 file changed

+37
-13
lines changed

1 file changed

+37
-13
lines changed

proposals/0501-swiftpm-html-coverage-report.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Review Manager: [David Cummings](https://github.com/daveyc123)
66
* Status: **Active Review (December 7 - December 22, 2025)**
77
* Implementation: [swiftlang/swift-package-manager#9076](https://github.com/swiftlang/swift-package-manager/pull/9076)
8-
* Review:
8+
* Review:
99
* [Pitch](https://forums.swift.org/t/pitch-adding-html-coverage-support/82358)
1010
* [Review](https://forums.swift.org/t/se-0501-html-coverage-report/83601/1)
1111

@@ -70,6 +70,30 @@ make use of LLVM's tools and construct the proper command line arguments to the
7070

7171
The proposted command line changes are as follows:
7272

73+
### Consolidate coverage option to use same argument "style"
74+
75+
Prior to this feature, there are 2 coverage options
76+
77+
```
78+
--show-codecov-path, --show-code-coverage-path, --show-coverage-path
79+
Print the path of the exported code coverage JSON
80+
--enable-code-coverage/--disable-code-coverage
81+
Enable code coverage. (default:
82+
--disable-code-coverage)
83+
```
84+
85+
There are 3 wayt to show the coverage path. This proposal recommends modify all
86+
coverage command line option to be a single, more useful option
87+
88+
```
89+
--show-coverage-path
90+
Print the path of the exported code coverage JSON
91+
--enable-coverage/--disable-coverage
92+
Enable code coverage. (default:
93+
--disable-coverage)
94+
```
95+
96+
This requires gracefully phasing out the previous option in favour of the new one.
7397

7498
### Format Selection
7599

@@ -81,7 +105,7 @@ specified.
81105
The command line option will be similar to:
82106

83107
```sh
84-
--codecov-format, --code-coverage-format, --coverage-format <format>
108+
--coverage-format <format>
85109
Format of the code coverage output. Can be specified multiple times. (default: json)
86110
json - Produces a JSON coverage report.
87111
html - Produces an HTML report produced by llvm-cov.
@@ -93,8 +117,9 @@ The command line option will be similar to:
93117
`llvm-cov show` has several report configurability options. In order to
94118
prevent a "command line arguments" explosion to `swift test`, the configuration
95119
options will be read from a response file. The optional response file will be
96-
located in `<repo>/.swiftpm/configuration/coverage.html.report.args.txt`. The
97-
response file will be supported.
120+
located in `<repo>/.swiftpm/configuration/coverage.html.report.args.txt`, which
121+
is the same location used by other SwiftPM features, such as registration and
122+
mirros configuration files. The response file will be supported.
98123

99124
The user can include `--format=text`, or a variation thereof, in the response
100125
file. In order to ensure SwiftPM will always generate an HTML report, SwiftPM
@@ -116,15 +141,14 @@ assumption that the CI system will have a copy of the repository in the "sandbox
116141
location, allowing this system to upload the HTML report.
117142

118143
```
119-
--show-codecov-path [mode], --show-code-coverage-path [mode], --show-coverage-path [mode]
144+
--show-coverage-path [mode]
120145
Print the path of the exported code coverage files. The mode specifies how to
121146
display the paths of the selected code coverage file formats. (default: text)
122147
json - Display the output in JSON format.
123148
text - Display the output as plain text.
124-
--show-codecov-path-mode, --show-code-coverage-path-mode, --show-coverage-path-mode <show-codecov-path-mode>
125-
--enable-codecov, --enable-code-coverage, --enable-coverage/--disable-codecov, --disable-code-coverage, --disable-coverage
149+
--enable-coverage/--disable-coverage
126150
Enable code coverage. (default: --disable-codecov)
127-
--codecov-format, --code-coverage-format, --coverage-format <format>
151+
--coverage-format <format>
128152
Format of the code coverage output. Can be specified multiple times. (values: json, html; default: Produces a JSON coverage report.)
129153
```
130154

@@ -196,12 +220,12 @@ No impact is expected.
196220
pass the arguments to `llvm-cov show` and override the values in the response
197221
file. This has _not_ been implemented in the [PR].
198222

199-
- Instead of having a `--show-codecov-path` as a tri-state, we could preserve
200-
`--show-codecov-path` original behaviour and add an additional command line
223+
- Instead of having a `--show-coverage-path` as a tri-state, we could preserve
224+
`--show-coverage-path` original behaviour and add an additional command line
201225
argument to indicate the output mode. The comand line argument would be
202-
`--show-codecov-path-mode <mode>`, where `<mode>` is either `text` or `json`.
203-
This was not favours as `--show-codecov-path-mode` would have a dependency on
204-
`--show-codecov-path` argument, and may lead to some confusion.
226+
`--show-coverage-path-mode <mode>`, where `<mode>` is either `text` or `json`.
227+
This was not favoured as `--show-coverage-path-mode` would have a dependency on
228+
`--show-coverage-path` argument, and may lead to some confusion.
205229

206230

207231
[PR]: https://github.com/swiftlang/swift-package-manager/pull/9076

0 commit comments

Comments
 (0)