Skip to content

UP030 replaces regex repetitions #19348

Open
@tobixx

Description

@tobixx

Summary

Regex repetitions are partially removed by this rule, example:

-    _re_date = r'(?P<day>\d{{1,2}})(?P<month>{0})'.format('|'.join(_months))
+    _re_date = r'(?P<day>\d{{,2}})(?P<month>{})'.format('|'.join(_months))
  • 1 is removed in the regex expression: \d{{1,2}}
  • format has only one parameter, removing any other but {0} in this case is wrong anyway

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixesRelated to suggested fixes for violations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions