[Python] Add inline disabling of specific rule

Currently Sonar has no option to disable specific rule for certain line in Python code. It is possible to completely disable certain line check via “# /NOSONAR” but that’s not the case if we would like to suppress only certain check. Something line: “# noinspection <rule_name>” would be great.

Hi,

This is available in the UI. Would you mind giving your use case for doing it in code instead?

 
Thx,
Ann

Sharing in project to other users? Currently all of them should manually set that, disabling it via code could be more elegant.

pon., 29 sie 2022, 18:35 użytkownik G Ann Campbell via Sonar Community <notifications@sonarcommunity.discoursemail.com> napisał:

1 Like

Is it possible, that Sonar will incorporate that?

What about the same as @SuppressWarning(rule_id) in Java? Is consistency with the same tool in other language not a good reason by itself?
Btw another OBVIOUS reason is to make the rule project-dependent, and not IDE-dependent or user-dependent.