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

"struct" names should comply with a naming convention

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Rename this struct to match the regular expression ${format}
    • List of parameters:
      Hide

      Key: format
      Description: Regular expression struct names should match.
      Default: ^[A-Z][a-zA-Z0-9]*$
      Type: STRING

      Show
      Key: format Description: Regular expression struct names should match. Default: ^ [A-Z] [a-zA-Z0-9] *$ Type: STRING
    • Default Severity:
      Minor
    • Impact:
      Low
    • Likelihood:
      Low
    • Covered Languages:
      C, C++, Objective-C, Swift
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      10min

      Description

      Sharing some naming conventions enables teams to collaborate more efficiently. This rule checks that all struct names match a provided regular expression.

      Noncompliant Code Example

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

      struct myStruct {
        int one;
        int two;
      };
      

      Compliant Solution

      struct MyStruct {
        int one;
        int two;
      };
      

        Attachments

          Issue Links

          1.
          Swift RSPEC-2601 Language-Specification Active Unassigned

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ann.campbell.2 Ann Campbell
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: