This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] correct clang-tidy-diff.py help message
ClosedPublic

Authored by sugak on Jun 6 2016, 5:49 PM.

Details

Summary

Looks like the original code was copied from clang-format-diff.py.
Update help message to make it clang-tidy specific.

Diff Detail

Repository
rL LLVM

Event Timeline

sugak updated this revision to Diff 59813.Jun 6 2016, 5:49 PM
sugak retitled this revision from to [clang-tidy] correct clang-tidy-diff.py help message.
sugak updated this object.
sugak added reviewers: klimek, alexfh.
sugak added a subscriber: cfe-commits.
Eugene.Zelenko added inline comments.
clang-tidy/tool/clang-tidy-diff.py
42 ↗(On Diff #59813)

Shouldn't -p be used to specify compile database as in run-clang-tidy.py?

sugak added inline comments.Jun 6 2016, 7:15 PM
clang-tidy/tool/clang-tidy-diff.py
42 ↗(On Diff #59813)

From the test plan it looks like this script doesn't support compilation database input:

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.

alexfh accepted this revision.Jun 7 2016, 2:03 AM
alexfh edited edge metadata.

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

Do you need me to commit the patch for you?

clang-tidy/tool/clang-tidy-diff.py
42 ↗(On Diff #59813)

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.

This revision is now accepted and ready to land.Jun 7 2016, 2:03 AM
sugak added a comment.Jun 7 2016, 8:54 AM

Thank you for the review! I need someone to commit this for me :)

This revision was automatically updated to reflect the committed changes.