coverlet: No match found error when excluding multiple namespaces

Hi, As suggested by @MarcoRossignoli I’m opening this issue after the short conversation on #56 When trying to use Exclude filter in MSBuild task integration to exclude more than one namespace I get some errors:

dotnet test --configuration Develop /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=TestResults/Coverage/ /p:Exclude=\"[*]CustomControls*,[*]TinyIoC*\"
zsh: no matches found: /p:Exclude="[*]CustomControls*,[*]TinyIoC*"

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22

Most upvoted comments

zsh escaping is similar to sh or bash, you can find a maybe too detailed documentation here e.g.: http://zsh.sourceforge.net/Guide/zshguide05.html

Double quotes usually disables globbing, but in your example there is \" which means that the quoting is escaped. It will then treat * as a globbing pattern, which fails since it of course doesn’t match any files. You can try just removing the backslashes:

dotnet test --configuration Develop /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=TestResults/Coverage/ /p:Exclude="[*]CustomControls*,[*]TinyIoC*"

or if the double quotes are somehow needed for the msbuild task use single qoutes around the whole thing to preserve both double quotes and the pattern as-is:

dotnet test --configuration Develop /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=TestResults/Coverage/ '/p:Exclude="[*]CustomControls*,[*]TinyIoC*"'

Oh sorry again take a look at escape syntax like our build https://github.com/coverlet-coverage/coverlet/blob/master/eng/build.yml

Last test task Does it work?

Thanks, it finally worked with %2c suggestion and yes the test task works

@MarcoRossignoli Also I wanna say thank you for the tremendous efforts you guys put in this tool 😃