This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] added JSON output to clang-tidy-diff.py
AcceptedPublic

Authored by kuhnel on Jan 20 2022, 4:31 AM.

Details

Summary

This makes it easier to process the clang-tidy output in other tools.
For far it's only parsing the findings, not the output on stderr.

For testing you can use:

bash
ninja clangd
COMMIT=4dedd82cc99341d757a9cc07a8b7b22c8bb61d19
git diff $COMMIT~ $COMMIT | python3 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -p1 -json -checks="*"

This is part of the effort towards re-enabling clang-tidy in
pre-merge testing. With JSON output, we can deprecate some local
code in pre-merge testing.

https://github.com/google/llvm-premerge-checks/issues/367

Diff Detail

Event Timeline

kuhnel created this revision.Jan 20 2022, 4:31 AM
kuhnel requested review of this revision.Jan 20 2022, 4:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2022, 4:31 AM
goncharov accepted this revision.Feb 3 2022, 6:22 AM
This revision is now accepted and ready to land.Feb 3 2022, 6:22 AM
shafik added a subscriber: shafik.Sep 26 2023, 2:04 PM

Is this change still relevant of can we close this PR?

Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: PiotrZSL. · View Herald Transcript