You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/Changelog.md
+4
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## Unreleased
8
8
9
+
### Breaking changes
10
+
- New parameter `ExcludeAssembliesWithoutSources` to control automatic assembly exclusion [1164](https://github.com/coverlet-coverage/coverlet/issues/1164). The parameter `InstrumentModulesWithoutLocalSources` has been removed. since it can be handled by setting `ExcludeAssembliesWithoutSources` to `None`.
11
+
- The default heuristics for determining whether to instrument an assembly has been changed. In previous versions any missing source file was taken as a signal that it was a third-party project that shouldn't be instrumented, with exceptions for some common file name patterns for source generators. Now only assemblies where no source files at all can be found are excluded from instrumentation, and the code for detecting source generator files have been removed. To get back to the behaviour that at least one missing file is sufficient to exclude an assembly, set `ExcludeAssembliesWithoutSources` to `MissingAny`, or use assembly exclusion filters for more fine-grained control.
Copy file name to clipboardExpand all lines: Documentation/MSBuildIntegration.md
+16
Original file line number
Diff line number
Diff line change
@@ -228,3 +228,19 @@ To generate deterministc report the parameter is:
228
228
```
229
229
/p:DeterministicReport=true
230
230
```
231
+
232
+
## Exclude assemblies without sources from coverage
233
+
234
+
The heuristic coverlet uses to determine if an assembly is a third-party dependency is based on the matching of the assembly`s source documents and the corresponding source files.
235
+
This parameter has three different values to control the automatic assembly exclusion.
236
+
237
+
| Parameter | Description |
238
+
|-----------|-------------|
239
+
| MissingAll | Includes the assembly if at least one document is matching. In case the `ExcludeAssembliesWithoutSources` parameter is not specified the default value is `MissingAll`. |
240
+
| MissingAny | Includes the assembly only if all documents can be matched to corresponding source files. |
241
+
| None | No assembly is excluded. |
242
+
243
+
Here is an example of how to specifiy the parameter:
Copy file name to clipboardExpand all lines: Documentation/VSTestIntegration.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -97,8 +97,8 @@ These are a list of options that are supported by coverlet. These can be specifi
97
97
| IncludeTestAssembly | Include coverage of the test assembly. |
98
98
| SkipAutoProps | Neither track nor record auto-implemented properties. |
99
99
| DoesNotReturnAttribute | Methods marked with these attributes are known not to return, statements following them will be excluded from coverage |
100
-
| DeterministicReport | Generates deterministic report in context of deterministic build. Take a look at [documentation](DeterministicBuild.md) for further informations.|
101
-
|InstrumentModulesWithoutLocalSources |Specifies whether modules should be instrumented even if the sources from the PDBs can't be found locally. |
100
+
| DeterministicReport | Generates deterministic report in context of deterministic build. Take a look at [documentation](DeterministicBuild.md) for further informations.
101
+
|ExcludeAssembliesWithoutSources |Specifies whether to exclude assemblies without source. Options are either MissingAll, MissingAny or None. Default is MissingAll.|
102
102
103
103
How to specify these options via runsettings?
104
104
@@ -120,7 +120,7 @@ How to specify these options via runsettings?
Copy file name to clipboardExpand all lines: src/coverlet.console/Program.cs
+2-2
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ static int Main(string[] args)
70
70
CommandOptionmergeWith=app.Option("--merge-with","Path to existing coverage result to merge.",CommandOptionType.SingleValue);
71
71
CommandOptionuseSourceLink=app.Option("--use-source-link","Specifies whether to use SourceLink URIs in place of file system paths.",CommandOptionType.NoValue);
72
72
CommandOptiondoesNotReturnAttributes=app.Option("--does-not-return-attribute","Attributes that mark methods that do not return.",CommandOptionType.MultipleValue);
73
-
CommandOptioninstrumentModulesWithoutLocalSources=app.Option("--instrument-modules-without-local-sources","Specifies whether modules should be instrumented even if the sources from the PDBs can't be found locally.",CommandOptionType.NoValue);
73
+
CommandOptionexcludeAssembliesWithoutSources=app.Option("--exclude-assemblies-without-sources","Specifies behaviour of heuristic to ignore assemblies with missing source documents.",CommandOptionType.SingleValue);
0 commit comments