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

New Rule Proposal: SA1404 but for ExcludeFromCoverage #3877

Open
mu88 opened this issue Jul 17, 2024 · 0 comments
Open

New Rule Proposal: SA1404 but for ExcludeFromCoverage #3877

mu88 opened this issue Jul 17, 2024 · 0 comments

Comments

@mu88
Copy link

mu88 commented Jul 17, 2024

I'd appreciate having a warning for cases when [ExcludeFromCoverage] is used without a justification, similar to SA1404.

For example, the following code would be a rule violation...

[ExcludeFromCoverage]
public bool Enable()
{
}

...and adding a justification would fix the violation:

[ExcludeFromCoverage(Justification = "Cannot be tested because...")]
public bool Enable()
{
}

If you consider this useful, I'd happily provide a PR.

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

No branches or pull requests

1 participant