Skip to content

Commit fa1a634

Browse files
Fix excludeByFile documentation (#833)
Fix excludeByFile documentation
1 parent 122df64 commit fa1a634

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Documentation/GlobalTool.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,10 @@ coverlet <ASSEMBLY> --target <TARGET> --targetargs <TARGETARGS> --exclude-by-att
172172
173173
You can also ignore specific source files from code coverage using the `--exclude-by-file` option
174174
- Can be specified multiple times
175-
- Use absolute or relative paths (relative to the project directory)
176175
- Use file path or directory path with globbing (e.g `dir1/*.cs`)
177176
178177
```bash
179-
coverlet <ASSEMBLY> --target <TARGET> --targetargs <TARGETARGS> --exclude-by-file "../dir1/class1.cs"
178+
coverlet <ASSEMBLY> --target <TARGET> --targetargs <TARGETARGS> --exclude-by-file "**/dir1/class1.cs"
180179
```
181180
182181
### Filters

Documentation/MSBuildIntegration.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,10 @@ dotnet test /p:CollectCoverage=true /p:ExcludeByAttribute="Obsolete,GeneratedCod
120120
### Source Files
121121
You can also ignore specific source files from code coverage using the `ExcludeByFile` property
122122
- Use single or multiple paths (separate by comma)
123-
- Use absolute or relative paths (relative to the project directory)
124123
- Use file path or directory path with globbing (e.g `dir1/*.cs`)
125124

126125
```bash
127-
dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"../dir1/class1.cs,../dir2/*.cs,../dir3/**/*.cs\"
126+
dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/dir1/class1.cs,**/dir2/*.cs,**/dir3/**/*.cs\"
128127
```
129128

130129
### Filters

Documentation/VSTestIntegration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ How to specify these options via runsettings?
9292
<Exclude>[coverlet.*.tests?]*,[*]Coverlet.Core*</Exclude> <!-- [Assembly-Filter]Type-Filter -->
9393
<Include>[coverlet.*]*,[*]Coverlet.Core*</Include> <!-- [Assembly-Filter]Type-Filter -->
9494
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
95-
<ExcludeByFile>../dir1/class1.cs,../dir2/*.cs,../dir3/**/*.cs,</ExcludeByFile> <!-- Absolute or relative file paths -->
95+
<ExcludeByFile>**/dir1/class1.cs,**/dir2/*.cs,**/dir3/**/*.cs,</ExcludeByFile> <!-- Globbing filter -->
9696
<IncludeDirectory>../dir1/,../dir2/,</IncludeDirectory>
9797
<SingleHit>false</SingleHit>
9898
<UseSourceLink>true</UseSourceLink>

0 commit comments

Comments
 (0)