llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.83k stars 11.46k forks source link

The script clang-tidy-diff.py doesn't accept 'pass by' options (--) #37600

Open llvmbot opened 6 years ago

llvmbot commented 6 years ago
Bugzilla Link 38252
Version unspecified
OS All
Attachments clang-tidy-diff.py with proposed correction
Reporter LLVM Bugzilla Contributor
CC @EugeneZelenko

Extended Description

When the argument -- is passed to clang-tidy-diff.py it should pass the following arguments to clang-tidy. It does that but also includes -- as an argument,

in line 73, https://github.com/llvm-mirror/clang-tools-extra/blob/master/clang-tidy/tool/clang-tidy-diff.py#L73 there should be a +1 in the '--' index.

So only the following arguments as passed to clang-tidy.

It should read: clang_tidy_args.extend(argv[argv.index('--')+1:])

llvmbot commented 6 years ago

Link to the suggested patch: https://reviews.llvm.org/D49864

EugeneZelenko commented 6 years ago

I'll be better to suggest patch on https://reviews.llvm.org.