Skip to content

[BUG][clang-tidy-diff] SyntaxWarning: invalid escape sequence #92948

Closed
@Jacobfaib

Description

@Jacobfaib
clang-tidy-diff.py:245: SyntaxWarning: invalid escape sequence '\+'
  match = re.search('^\+\+\+\ "?(.*?/){%s}([^ \t\n"]*)' % args.p, line)
clang-tidy-diff.py:258: SyntaxWarning: invalid escape sequence '\+'
  match = re.search("^@@.*\+(\d+)(,(\d+))?", line)

Using python:

$ python3 -VV
Python 3.12.3 (main, Apr  9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)]

It seems these strings need to be raw strings:

match = re.search(r'^\+\+\+\ "?(.*?/){%s}([^ \t\n"]*)' % args.p, line)
#                 ^ note

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions