Make it more explicit what a covered or a partial quickfix means

This commit is contained in:
Loïc Joly 2021-10-13 15:23:02 +02:00 committed by GitHub
parent 2136dca525
commit 0553b63456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,17 +219,25 @@ It is infeasible to synchronize the implementation of the rule for all the langu
.. Bob merges the rule implementation in Cobol analyzer.
.. If Bob had opened an RSPEC PR with changes, he merges it once the rule is implemented in the analyzer.
== Quickfix field
== `quickfix` field
Every active rule that is not a security hotspot must specify the availability of a quickfix for its issues.
Every active rule that is not a security hotspot must specify the availability of a quick fix for its issues.
`metadata.json` must feature a `quickfix` field with one of the following values:
* `unknown`: the feasibility of producing a quickfix is not evaluated.
* `infeasible`: it is not feasible to propose a quickfix for any of the issues, for whatever reason.
* `targeted`: it is possible to implement quickfixes for this rule, but none are implemented right now.
* `partial`: some of the issues produced by the rule propose a quickfix, but not all.
* `covered`: all the issues produced by the rule propose a quickfix.
* `unknown`: the feasibility of producing a quick fix is not evaluated.
* `infeasible`: it is not feasible to propose a quick fix for any of the issues, for whatever reason.
* `targeted`: it is possible to implement quick fixes for this rule, but none are implemented right now.
* `partial`: some of the issues produced by the rule propose a quick fix, but not all.
* `covered`: all the issues produced by the rule propose a quick fix.
[NOTE]
====
A `covered` rule is still not guaranteed to provide a quick fix for a particular issue (for instance, if a fix location would be inside a macro expansion or in a different file from the issue location). The rule is said to have a `partial` quick fix only if there exists a family of issues that cannot have a quick fix.
For instance, on one hand, if a rule detects two functions that are dangerous to use, `A` and `B`, and `A` has an obvious replacement (and therefore a quick fix) while `B` does not, the field should be set to `partial`.
On the other hand, if a quick fix could be easily proposed for both `A` and `B`, but the fix location might be inside a macro expansion, or in a different file from the issue location (and hence not feasible given the current SonarLint capabilities), this should not prevent the rule from being tagged as `covered`.
====
== Comment a rule
Comments and links that were created on Jira have been gathered in a `comments-and-links.adoc` file for each concerned rule. +