Closed marco-carvalho closed 3 months ago
Based on the documentation, rules that are disabled by default must be explicitly enabled:
Analyzer rules that are marked as disabled by default in the analyzer package must be enabled through explicit dotnet_diagnostic.
.severity = entries.
As CA1849 is disabled by default, adding the following line should work:
dotnet_diagnostic.CA1849.severity = error
Thanks @mpidash
Describe the bug
When configuring the
dotnet_analyzer_diagnostic.category-Performance.severity
option in the.editorconfig
file toerror
, the expected behavior is that all performance category rules, including CA1849, will be treated as errors. However, CA1849 does not get reported as an error when the code violates this rule, despite other performance category rules being correctly reported as errors. This inconsistency suggests that the CA1849 diagnostic is not respecting the configuration setting specified for the performance category.Steps To Reproduce
Expected behavior
The build process should fail, and an error should be reported for CA1849 violation.
Actual behavior
The build completes successfully, and no error is reported for the CA1849 violation.