Open
Description
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:
- have a parameter in the .editorconfig to add additional attributes to the skipped list
- 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
- 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
-
- The above listed attributes added to
WellKnownTypeNames
- The above listed attributes added at: https://github.com/dotnet/roslyn-analyzers/blob/main/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/QualityGuidelines/MarkMembersAsStatic.cs
- The above listed attributes added to
Additional context
TUnit documentation: https://thomhurst.github.io/TUnit/docs/intro
Metadata
Metadata
Assignees
Labels
No labels
Activity