Skip to content

New feature: disable autofix for specific rules in .editorConfig #70428

@urmel9

Description

@urmel9
  • Operating system: Windows
  • IDE: Visual Studio 2022 (64 bit) Version 17.7.5
  • Plugin: SonarAnalyzer.CSharp Version 9.8.0.76515
  • Plugin: StyleCop.Analyzers Version 1.2.0-beta.435

Summary

We want to control which autofixes for specific rules are enabled or not.

Background and Motivation

Beside of the inbuilt-feature Roslyn, we use two Linters: SonarAnalyzers and StyleCop. Here, we activated the function to use the code-cleanup on save that are specified in the .editorConfig. For some rules, we don't need the autofix-feature because it's bugged or just useful. So if we want to turn off the autofix we have to change the severity. Though, some rules are useful to showed but not just the fix.

Proposed Feature

Now we asked SonarLint to add an feature to disable the autofix for specific rules:
New feature: disable autofix for specific rules in .editorConfig](https://community.sonarsource.com/t/new-feature-disable-autofix-for-specific-rules-in-editorconfig/102315/17)
The product manager said we have to ask roslyn because you are maintaining the .editorConfig.

Could you please add a feature that we can disable the autofix-feature for specific rules of Roslyn and third-party analyzers? For example like this:
dotnet_diagnostic.SA1202.autofix = false

Alternative

.eslint is also offering this feature.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions