Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy-diff.py is not working for git diff with multiple files #25011

Closed
llvmbot opened this issue Aug 31, 2015 · 1 comment
Closed

clang-tidy-diff.py is not working for git diff with multiple files #25011

llvmbot opened this issue Aug 31, 2015 · 1 comment
Labels
bugzilla Issues migrated from bugzilla clang-tidy

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 31, 2015

Bugzilla Link 24637
Resolution FIXED
Resolved on Sep 01, 2015 14:15
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

recent changes in clang-tidy-diff.py breaks compatibilty with git diff

Here is a breaking commit (wrong regexp, incorrectly treats '\n' as not whitespace)
llvm-mirror/clang-tools-extra@0ca9a2b

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 1, 2015

The regex in r245683 is
match = re.search('^+++\ "?(.?/){%s}([^ \t\"])' % args.p, line)
while the regex in your e-mail was
match = re.search('^+++\ "?(.?/){%s}([^ \t\"\n])' % args.p, line)

there are three changes between the regexs.

  1. The additional \n I understand.
  2. , + are not escaped which I do not understand why as + is a special character in Python regex (see https://docs.python.org/2/library/re.html).
  3. The star after [^ \t\"\n] went missing.

I've committed 1), additional \n on r246575. I hope this is enough to fix the issue but without an example cannot test this.
If more changes are needed please reopen the bug with a short example diff that breaks the regex so I can test everything before committing.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-tidy
Projects
None yet
Development

No branches or pull requests

1 participant