Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ExcludeByAttribute option (#232) #233

Merged
merged 7 commits into from
Nov 28, 2018
Merged

feat: Add ExcludeByAttribute option (#232) #233

merged 7 commits into from
Nov 28, 2018

Conversation

amweiss
Copy link
Contributor

@amweiss amweiss commented Nov 5, 2018

I think this is generally working, but I'm looking for a better way to automate the test for the MSBUILD task and CLI tool to make sure I didn't miss something.

If someone else can pull this and test it for their usage, I'll feel better about it and remove the [WIP] and say it's ready to merge.

Otherwise, there's also a whole bunch of random style and whitespace changes I'd like to make but don't want to mess up this PR for that and will do it in a later one. I tried to keep everything in the same pattern as the existing things, but it's not exactly how I would normally do it.

@codecov
Copy link

codecov bot commented Nov 5, 2018

Codecov Report

Merging #233 into master will increase coverage by 0.37%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #233      +/-   ##
==========================================
+ Coverage   94.91%   95.29%   +0.37%     
==========================================
  Files          15       16       +1     
  Lines        1633     1699      +66     
==========================================
+ Hits         1550     1619      +69     
+ Misses         83       80       -3
Impacted Files Coverage Δ
src/coverlet.core/Instrumentation/Instrumenter.cs 98.94% <100%> (+0.01%) ⬆️
src/coverlet.core/Coverage.cs 99.49% <100%> (ø) ⬆️
src/coverlet.core/Reporters/JsonReporter.cs 50% <0%> (-16.67%) ⬇️
src/coverlet.core/Reporters/LcovReporter.cs 96% <0%> (-1.96%) ⬇️
src/coverlet.core/Reporters/CoberturaReporter.cs 98.55% <0%> (-0.72%) ⬇️
src/coverlet.core/Reporters/OpenCoverReporter.cs 99.11% <0%> (-0.44%) ⬇️
src/coverlet.core/Reporters/ReporterFactory.cs 100% <0%> (ø) ⬆️
src/coverlet.core/Reporters/TeamCityReporter.cs 100% <0%> (ø)
src/coverlet.core/CoverageSummary.cs 99.14% <0%> (+6.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b54c93c...643e1a5. Read the comment docs.

"ExcludeFromCoverage",
nameof(ExcludeFromCodeCoverageAttribute),
"ExcludeFromCodeCoverage"
nameof(ExcludeFromCodeCoverageAttribute)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a backward incompatible change. We should make specifying the Attribute suffix optional

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually incompatible? From what I saw of the usage even if you use the short name attribute like [ExcludeFromCoverage] the attribute name still comes across with the full name ExcludeFromCoverageAttribute. Were you trying to account for people writing custom attributes to handle excluding from coverage that were named the same as your attributes?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more of a user experience thing. Since the compiler doesn't enforce the Attribute suffix I don't want us to as well. I want the user to be able to specify Obsolete and still be fine. You can simply append Attribute to the name if it's not specified


```bash
dotnet test /p:CollectCoverage=true /p:ExcludeByAttribute="ObsoleteAttribute,GeneratedCodeAttribute,CompilerGeneratedAttribute"
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should mention that the Attribute suffix is optional. See my other comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a sight fear since it wasn't using the fully qualified name that it could cause issues, but I can make the it try to do the short name resolution like the compiler as well.

@amweiss
Copy link
Contributor Author

amweiss commented Nov 13, 2018

I think I addressed the items in your comments @tonerdo

@amweiss amweiss changed the title [WIP] feat: Add first pass at ExcludeAttributes option (#232) feat: Add ExcludeAttributes option (#232) Nov 15, 2018
@amweiss amweiss changed the title feat: Add ExcludeAttributes option (#232) feat: Add ExcludeByAttributes option (#232) Nov 15, 2018
@amweiss amweiss changed the title feat: Add ExcludeByAttributes option (#232) feat: Add ExcludeByAttribute option (#232) Nov 15, 2018
@tonerdo
Copy link
Collaborator

tonerdo commented Nov 20, 2018

@amweiss This is ready to go, modulo one more comment

@amweiss
Copy link
Contributor Author

amweiss commented Nov 20, 2018

@tonerdo Change made.

@tonerdo
Copy link
Collaborator

tonerdo commented Nov 22, 2018

This is ready to go. Will merge once I'm ready to make a new release

@tonerdo tonerdo merged commit 1a28fcd into coverlet-coverage:master Nov 28, 2018
@amweiss amweiss deleted the feature/exclude-by-attribute branch November 28, 2018 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants