Uploaded image for project: 'SonarPython'
  1. SonarPython
  2. SONARPY-638

FP on S5720 on method Enum._generate_next_value_

    Details

    • Type: False-Positive
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.8
    • Fix Version/s: None
    • Component/s: Rules
    • Labels:
      None

      Description

      Subclasses of Enum can define a method called generate_next_value. It doesn't have a "self" or "cls" parameter. Rule RSPEC-5720 raises a False Positive on this method.

      class MyAutoName(Enum):
           def _generate_next_value_(name, start, count, last_values): # False Positive 
               return name
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nicolas.harraudeau Nicolas Harraudeau
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: