This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add exit code support to clang-tidy-diff.py
ClosedPublic

Authored by PiotrZSL on Aug 26 2023, 5:09 AM.
Tokens
"Like" token, awarded by FlashSheridan.

Details

Summary

Modify script to fail when some run clang-tidy
command fails. Based on run_clang-tidy.

Fixes: #65000

Diff Detail

Event Timeline

PiotrZSL created this revision.Aug 26 2023, 5:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2023, 5:09 AM
Herald added a subscriber: xazax.hun. · View Herald Transcript
PiotrZSL requested review of this revision.Aug 26 2023, 5:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2023, 5:09 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thank you, looks promising and I will test it on Monday.

A couple of low-priority suggestions from Pylint 3 at 326 and 95:

clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
95

Pylint 3 says > “[R0913(too-many-arguments), start_workers] Too many arguments (6/5),”

I think you just pushed start_workers() over the edge; personally, I don’t think a rewrite to reduce the number of arguments would improve clarity.

324

Pylint 3 says: > [C1802(use-implicit-booleaness-not-len), main] Do not use len(SEQUENCE) without comparison to determine if a sequence is empty

(I have no strong feelings.)
PiotrZSL updated this revision to Diff 554028.Aug 28 2023, 1:02 PM
PiotrZSL marked 2 inline comments as done.

Fix some Pylint issues.

Thank you kindly, this is looking very good on our recent changes in my manual usage. (It will take some more work before I can run it in our GitHub Action, which I’m looking forward to.)

This revision is now accepted and ready to land.Aug 31 2023, 12:07 PM
This revision was automatically updated to reflect the committed changes.