Skip to content

Commit

Permalink
Broken exclude-by-attribute feature in coverlet.console (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
daveMueller authored Feb 26, 2024
1 parent 59430c3 commit 9ee7b8f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Documentation/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed
- Exception when multiple exclude-by-attribute filters specified [#1624](https://github.com/coverlet-coverage/coverlet/issues/1624)

### Improvements
- More concise options to specify multiple parameters in coverlet.console [#1624](https://github.com/coverlet-coverage/coverlet/issues/1624)

## Release date 2024-02-19
### Packages
coverlet.msbuild 6.0.1
coverlet.console 6.0.1
coverlet.collector 6.0.1

### Fixed
- Uncovered lines in .NET 8 for inheriting records [#1555](https://github.com/coverlet-coverage/coverlet/issues/1555)
- Fix record constructors not covered when SkipAutoProps is true [#1561](https://github.com/coverlet-coverage/coverlet/issues/1561)
Expand Down
8 changes: 7 additions & 1 deletion Documentation/GlobalTool.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@ Options:
-?, -h, --help Show help and usage information
```

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

```shell
--exclude-by-attribute 'Obsolete' --exclude-by-attribute 'GeneratedCode' --exclude-by-attribute 'CompilerGenerated'
```

or pass the multiple values as space separated sequence, i.e.

```shell
--exclude-by-attribute "Obsolete" "GeneratedCode" "CompilerGenerated"
```

For `--merge-with` [check the sample](Examples.md).

## Code Coverage
Expand Down
2 changes: 1 addition & 1 deletion src/coverlet.console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static int Main(string[] args)
var includeFilters = new Option<string[]>("--include", "Filter expressions to include only specific modules and types.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
var excludedSourceFiles = new Option<string[]>("--exclude-by-file", "Glob patterns specifying source files to exclude.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
var includeDirectories = new Option<string[]>("--include-directory", "Include directories containing additional assemblies to be instrumented.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
var excludeAttributes = new Option<string[]>("--exclude-by-attribute", "Attributes to exclude from code coverage.") { Arity = ArgumentArity.ZeroOrOne, AllowMultipleArgumentsPerToken = true };
var excludeAttributes = new Option<string[]>("--exclude-by-attribute", "Attributes to exclude from code coverage.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
var includeTestAssembly = new Option<bool>("--include-test-assembly", "Specifies whether to report code coverage of the test assembly.") { Arity = ArgumentArity.Zero };
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 };
var skipAutoProp = new Option<bool>("--skipautoprops", "Neither track nor record auto-implemented properties.") { Arity = ArgumentArity.Zero };
Expand Down

0 comments on commit 9ee7b8f

Please sign in to comment.