Skip to content

Commit 9ee7b8f

Browse files
authored
Broken exclude-by-attribute feature in coverlet.console (#1627)
1 parent 59430c3 commit 9ee7b8f

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

Documentation/Changelog.md

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
### Fixed
10+
- Exception when multiple exclude-by-attribute filters specified [#1624](https://github.com/coverlet-coverage/coverlet/issues/1624)
11+
12+
### Improvements
13+
- More concise options to specify multiple parameters in coverlet.console [#1624](https://github.com/coverlet-coverage/coverlet/issues/1624)
14+
15+
## Release date 2024-02-19
16+
### Packages
17+
coverlet.msbuild 6.0.1
18+
coverlet.console 6.0.1
19+
coverlet.collector 6.0.1
20+
921
### Fixed
1022
- Uncovered lines in .NET 8 for inheriting records [#1555](https://github.com/coverlet-coverage/coverlet/issues/1555)
1123
- Fix record constructors not covered when SkipAutoProps is true [#1561](https://github.com/coverlet-coverage/coverlet/issues/1561)

Documentation/GlobalTool.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,18 @@ Options:
4242
-?, -h, --help Show help and usage information
4343
```
4444

45-
NB. For a [multiple value] options you have to specify values multiple times i.e.
45+
NB. For [multiple value] options you can either specify values multiple times i.e.
4646

4747
```shell
4848
--exclude-by-attribute 'Obsolete' --exclude-by-attribute 'GeneratedCode' --exclude-by-attribute 'CompilerGenerated'
4949
```
5050

51+
or pass the multiple values as space separated sequence, i.e.
52+
53+
```shell
54+
--exclude-by-attribute "Obsolete" "GeneratedCode" "CompilerGenerated"
55+
```
56+
5157
For `--merge-with` [check the sample](Examples.md).
5258

5359
## Code Coverage

src/coverlet.console/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static int Main(string[] args)
4040
var includeFilters = new Option<string[]>("--include", "Filter expressions to include only specific modules and types.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
4141
var excludedSourceFiles = new Option<string[]>("--exclude-by-file", "Glob patterns specifying source files to exclude.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
4242
var includeDirectories = new Option<string[]>("--include-directory", "Include directories containing additional assemblies to be instrumented.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
43-
var excludeAttributes = new Option<string[]>("--exclude-by-attribute", "Attributes to exclude from code coverage.") { Arity = ArgumentArity.ZeroOrOne, AllowMultipleArgumentsPerToken = true };
43+
var excludeAttributes = new Option<string[]>("--exclude-by-attribute", "Attributes to exclude from code coverage.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
4444
var includeTestAssembly = new Option<bool>("--include-test-assembly", "Specifies whether to report code coverage of the test assembly.") { Arity = ArgumentArity.Zero };
4545
var singleHit = new Option<bool>("--single-hit", "Specifies whether to limit code coverage hit reporting to a single hit for each location") { Arity = ArgumentArity.Zero };
4646
var skipAutoProp = new Option<bool>("--skipautoprops", "Neither track nor record auto-implemented properties.") { Arity = ArgumentArity.Zero };

0 commit comments

Comments
 (0)