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

CA1822 - Support for TUnit #7453

Open
viceroypenguin opened this issue Oct 17, 2024 · 0 comments
Open

CA1822 - Support for TUnit #7453

viceroypenguin opened this issue Oct 17, 2024 · 0 comments

Comments

@viceroypenguin
Copy link

Analyzer

Diagnostic ID: CA1822

Describe the improvement

Currently, CA1822 provides exclusions when attributes from XUnit, MSTest, and NUnit are applied to a method. I am in the process of migrating to TUnit, a new testing framework; but since it does not use the same attributes, [Test] methods are being flagged by CA1822.

It would be helpful to either/both:

  1. have a parameter in the .editorconfig to add additional attributes to the skipped list
  2. add TUnit.Core.TestAttribute, TUnit.Core.BeforeAttribute, TUnit.Core.BeforeEveryAttribute, TUnit.Core.AfterAttribute, TUnit.Core.AfterEveryAttribute` to the exclusion list.

Describe suggestions on how to achieve the rule

  1. Am not familiar enough with the process to provide clear directions on how to improve. Expected .editorconfig might look something like:
dotnet_code_quality.CA1822.excluded_attributes = T:TUnit.Core.TestAttribute, T:TUnit.Core.BeforeAttribute

Additional context

TUnit documentation: https://thomhurst.github.io/TUnit/docs/intro

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