Uploaded image for project: 'Rules Manager'
  1. Rules Manager
  2. RULEAPI-482

Provide "Anaysis Scope" in the rule metadata

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.18
    • Component/s: metadata
    • Labels:
      None

      Description

      RSPEC database has a "Analysis Scope" field which specifies whether the rule applies to main source, test sources or both. However this is not consistently used by analyzers (partially for historical reason) and it is not visible in the rule description.

      First step is for that particular information to be available in the rule metadata.
      This field should be added to the rule schema (rule-metadata-schema.json). Its name should be "scope" and its value should be a string with 3 possible values "Main", "Tests" and "All".
      For backward compatibility if the field is absent in the RSPEC, the default value should be "Main".

      This field will eventually be used by:

      • Analyzers to automatically run the rules on the appropriate scope
      • rules.sonarsource.com to display the scope as part as the rule description
      • SQ to display the scope as part as the rule description
          "scope": {
            "type": "string",
            "enum": ["Main","Tests","All"],
            "description": "scope the rule applies to"
          },
      

        Attachments

          Activity

            People

            Assignee:
            xavier.bourguignon Xavier Bourguignon (Inactive)
            Reporter:
            jeanchristophe.collet Jean-Christophe Collet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: