Reserved or open tag names?

I’d like to create some custom tags, but don’t want to accidentally create one that then happens to appear during a SonarQube upgrade. Are there certain strings or patterns that are safe to use, i.e., that won’t ever be used by SonarQube, such as starting a tag name with two underscores?

IOW, is there a SonarQube tag analog of IP address 192.168/16?

Hi @MisterPi,

I am not aware of any such convention but it makes sense to me. @Chris @Martin_Bednorz any reason to not have a prefix preventing naming collisions? Otherwise I suggest we modify both “Built-in Rule Tags” and “Rules” pages of the doc by adding the following sentence:

SonarQube/SonarCloud may add new built-in tags in the future. You can prevent naming collisions by using the following prefix “cstm.”. No built-in tag will ever use this prefix.

We could also add automatically this prefix to new tags, but this requires changing SonarQube/SonarCloud.

Note that I’m open to other prefixes. I just prefer to avoid prefixes with only one letter or only special characters as users wouldn’t see a real difference between “style” and “.style”. Underscores, columns, slashes and backslashes are currently automatically removed from tags so “dot” looks like a good alternative.

Does it make sense?

Sounds good to me. Should I file this as a new feature request, just to make it official and all?

The prefix includes the dot, right? So I should have a tag like cstm.mytag ?

Are there any third-party plugins or rules that create their own tags? If so, it might make sense to have another “domain” (if you will) for those, separate from cstm. and the main space (reserved for Sonar).

(But then we might go “full Java” and have fifteen words separated by periods! :smiley: )

Hi @MisterPi,

No need to make a feature request. This thread should be enough. I’m just waiting for SonarQube/SonarCloud product manager’s to answer before moving this forward. They might have some problematic use cases in mind I am not aware of.

As for plugins, I have no idea which ones create tags. They could add any tags they want to their own rules, but I doubt that they would modify the tags of built-in rules, so this should not be an issue. I don’t think that we need to create a complex standard for custom tags.

Yes it includes the dot.

I was just wondering if there was a place where third parties could share custom rules they have written, sort of a github for SonarQube contributions. If so, you might want to have a separate domain for any tags that are created for those. So the breakdown would be something like:

cstm.foo - my own tag foo for inhouse use
cntrb.foo - used by a contributed rule
foo - (i.e., no periods) a tag from Sonar