[PATCH] D21050: [clang-tidy] correct clang-tidy-diff.py help message

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 7 02:03:54 PDT 2016


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

Looks good. Thank you for fixing the copy-paste failures!

Do you need me to commit the patch for you?


================
Comment at: clang-tidy/tool/clang-tidy-diff.py:42
@@ -41,3 +41,3 @@
                       help='path to clang-tidy binary')
   parser.add_argument('-p', metavar='NUM', default=0,
                       help='strip the smallest prefix containing P slashes')
----------------
sugak wrote:
> Eugene.Zelenko wrote:
> > Shouldn't -p be used to specify compile database as in run-clang-tidy.py?
> From the test plan it looks like this script doesn't support compilation database input:
> ```lang=bash
> git diff -U0 HEAD^ | clang-tidy-diff.py -checks=-*,misc-use-override -p1 -- -std=gnu++14
> ```
> It is similar to `patch`-like tools that process unified diff input -- uses `-p` to adjust file path. I can fix it in a separate diff, just need a better name for the current function of `-p`.
The -p flag (compilation database path) to clang-tidy can be specified after the `--`:

  git diff -U0 HEAD^ | clang-tidy-diff.py -checks=-*,misc-use-override -p1 -- -p path/to/compile_commands.json

It might be slightly confusing to have two -p flags, but both make sense.


http://reviews.llvm.org/D21050





More information about the cfe-commits mailing list