Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-6221

Concept names should comply with a naming convention

    XMLWordPrintable

    Details

    • List of parameters:
      • key = format
      • description = Regular expression used to check the class names against.
      • default = ^[A-Z][a-zA-Z0-9]*$
      • type = STRING
    • Default Severity:
      Minor
    • Impact:
      Low
    • Likelihood:
      Low
    • Default Quality Profiles:
      Sonar way
    • Targeted languages:
      C++
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      2min
    • Analysis Level:
      Syntactic Analysis
    • Analysis Scope:
      Main Sources, Test Sources

      Description

      Shared coding conventions allow teams to collaborate effectively. This rule checks that all C++ concept names match a provided regular expression.

      Noncompliant Code Example

      With default provided regular expression ^[A-Z][a-zA-Z0-9]*$:

      template <class T>
      concept integral = std::is_integral<T>_v; // Noncompliant
      

      Compliant Solution

      template <class T>
      concept Integral = std::is_integral<T>_v; // Compliant
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              abbas.sabra Abbas Sabra
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: