# Suppress individual rule violations in SonarLint for VS Code

**URL:** <https://community.sonarsource.com/t/suppress-individual-rule-violations-in-sonarlint-for-vs-code/32950>\
**Category:** VS Code\
**Tags:** python, vscode\
**Created:** [October 15, 2020, 7:52am UTC](https://community.sonarsource.com/t/suppress-individual-rule-violations-in-sonarlint-for-vs-code/32950 "2020-10-15T07:52:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaqp](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@kaqp](https://community.sonarsource.com/u/kaqp)\
**Post date:** [October 15, 2020, 7:52am UTC](https://community.sonarsource.com/t/suppress-individual-rule-violations-in-sonarlint-for-vs-code/32950/1 "2020-10-15T07:52:42Z")

</div>

Hello,  
I’m using VS Code 1.49.1 with SonarLint 1.17.0 (community) on Linux Mint 19 Tara. Python rule python:S1854 (unused assignment) is firing incorrectly. How can I suppress the individual instance without disabling the rule? [Visual Studio has Solution Explorer-\>References-\>Analyzers which is not present in VS code.] Also, where can I find the list of SonarLint settings that I can modify in settings.json in addition to those available in the Settings pane within VS code?

---

<div class="post-metadata">

**Author:** ![JBL\_SonarSource](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jbl_sonarsource/32/64_2.png) [@JBL\_SonarSource](https://community.sonarsource.com/u/JBL_SonarSource)\
**Post date:** [October 15, 2020, 8:40am UTC](https://community.sonarsource.com/t/suppress-individual-rule-violations-in-sonarlint-for-vs-code/32950/2 "2020-10-15T08:40:49Z")

</div>

Hello, thank you for your question.

The current situation is that manual suppression of Python rule violations is only supported in connected mode with SonarQube or SonarCloud: any issue marked as “false positive” or “won’t fix” on the server won’t be shown in the IDE.

Manual suppression in SonarLint without connected mode is a long debated feature, I believe it deserves a dedicated thread in the [suggest new feature](https://community.sonarsource.com/c/suggestions/features/14) category.

In SonarLint for VSCode, the full list of rules that can be toggled and configured in `settings.json` is available in the “SonarLint Rules” view in the explorer; this will help you browse existing rules, toggle their activation and check whether they support parameters.

![Screenshot from 2020-10-15 10-38-22](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/1/8/1825175913f6da0e894c444ddf9db1a9a6bb5659.png)

Finally, if you have a minimal reproducer for a false positive on `python:S1854`, could you please post it here so that we can investigate why this is happening and improve the product for everyone 🙂 ?

Thanks!

---

<div class="post-metadata">

**Author:** ![kaqp](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@kaqp](https://community.sonarsource.com/u/kaqp)\
**Post date:** [October 15, 2020, 9:57am UTC](https://community.sonarsource.com/t/suppress-individual-rule-violations-in-sonarlint-for-vs-code/32950/3 "2020-10-15T09:57:07Z")

</div>

Thanks for the quick reply! The false positive was not false though it was difficult to spot. The rule (Unused Assignment) says “A dead store happens when a local variable is assigned a value that is not read by any subsequent instruction.” The local variable (underlined with a red squiggle) was clearly being read about 20 lines later. It was not immediately obvious to me that variable was mistakenly used in a for loop between the original assignment and the read. The fact that it was in for loop made it more difficult for me to spot. I apologize.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [November 24, 2020, 9:48am UTC](https://community.sonarsource.com/t/suppress-individual-rule-violations-in-sonarlint-for-vs-code/32950/4 "2020-11-24T09:48:06Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
