- Operating system: Microsoft Visual Studio Community 2022 (64-Bit) - Current
- SonarLint plugin version: 22.214.171.124515
- Programming language you’re coding in: C#
- Is connected mode used: No
- Link to GitHub-Issue
we use SonarLint with StyleCop in our company. Because there are many small warning that could be autofixed on save, we use the feature “clean-code on save”.
Here is the problem:
The Autofix of S1125 is wrong. The rule and the description are definitely correct, but the autofix function is wrong. It changes if (testBool == false) to if (testBool). Screenshot are attached.
This is the fix:
Autofix should have this result:
We had some bugs because SonarLint changed it wrong and is missing the exclamation mark on negative boolean literals. Could you please fix this? We will use the rule quick then again. Thank you!
After clean-code on save