As a company we use SonarCloud but sometimes want to ignore rules. To do this we leave new rules as inactive and tag the rule with a “reviewed-donotactivate” tag we made.
We would like a way to exclude these from the SonarCloud rules when we review them. So like a negative tags filter. Show us everything without these tags.
An alternative might be another status so that rules could be “active, inactive, disabled”.
Unless there is a better way to achieve this behaviour?
Welcome to the community!
So you leave the rules active in the Quality Profile and just ignore the issues based on that tag?
Why not remove the rules from the Quality Profile? If you’re using the Sonar way profiles, you won’t be able to do that, but if you make a copy of the profile, it will be fully editable.
The down side is that when new rules are added to Sonar way, they won’t be added to your profile, so you’ll need to keep an eye on the diff between the two profiles and make sure it’s only what’s expected.
Thank you for the fast response. So what we do is every 6 weeks we review all inactive rules in our profiles. We sometimes limit this by rule introduction date. We then review if we should turn on any of the inactive rules. The snag is then that we often get rules we’ve marked with a tag to say we will not implement. This is not devastating but is annoying, we’d really like to exclude them in the search (negative tag search) or have another state active,inactive (new), inactive (off). Unless there is a nicer way to do this process and see rules we have not assessed.
I don’t understand the frequency. If it were every two months, I would assume you were looking for new rules added in the last upgrade. But why a 6-week cadence? Are you trying to gradually raise the bar?
If so, we recommend instead turning on all (interesting) rules at once and only focusing on new code.