Skip to content

Latest commit

 

History

History
82 lines (67 loc) · 4.98 KB

link_formatting.adoc

File metadata and controls

82 lines (67 loc) · 4.98 KB

We often want to provide links in the 'Resources' section of a rule that point to blog posts, documentation, and other rules. To provide a consistent experience across the Sonar solution, we want to define standard ways to write these links in our rules. This document aims to do that. This guidance does not apply to links that appear within continuous text elsewhere in a rule.

  • Links to documentation: <source> - <title> e.g. SonarQube Documentation - SonarScanner for Gradle

  • Links to framework documentation <source> - <member name and kind> e.g. Microsoft Learn - Object.ToString Method

  • Links to blog posts / news articles: <source> - <title> e.g. Google Security Blog - Moving towards a more secure web

  • Links to Stack Overflow answers (similar comments in a blog)e.g. Stack Overflow - Answer by Stephen Cleary for Best way to handle null task inside async method?

  • Links to another Sonar rule: <rulenumber> - <title> e.g. S2755 - XML parsers should not be vulnerable to XXE attacks. Note that rule-ids (<rulenumber>) are automatically hyperlinked in our products to point to the rule description in that product. Do not add any hyperlink yourself.

The hyperlink to anything apart from other Sonar rules should be applied to just the document name, with the 'source' being left as plain text. The idea is that this makes it really easy for a user to understand the source before they click on anything. For Sonar rules, the whole entry (<rulenumber> - <title>) should be a hyperlink.

Here is how the above links should look like:

  • Is the article (particularly blog posts) likely to be around for at least 6 months?

  • Do you trust this source as an 'expert'?

  • Link to en_US versions where there is a choice

Short form names for sources we regularly use

When web pages have massively long names like "Java™ Platform, Standard Edition 8 API Specification", we will provide short form names that we will use instead. Feel free to add new ones below:

Short form names to use: