This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Improve clang-format-diff.py error message
ClosedPublic

Authored by DavidSpickett on Mar 5 2021, 3:42 AM.

Details

Summary

Previously if we couldn't run the clang-format command
for some reason, you'd get an unhelpful error message:

OSError: [Errno 2] No such file or directory

Which doesn't tell you what was happening to cause this.

Catch the error and add the command we were attempting to run:

RuntimeError: Failed to run "<...>/clang-food <...>" - No such file or directory"
RuntimeError: Failed to run "<...>/clang-format <...>" - Permission denied"

Diff Detail

Event Timeline

DavidSpickett requested review of this revision.Mar 5 2021, 3:42 AM
DavidSpickett created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 5 2021, 3:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
krasimir accepted this revision.Mar 5 2021, 5:03 AM

LGTM.

Thank you!

This revision is now accepted and ready to land.Mar 5 2021, 5:03 AM
This revision was landed with ongoing or failed builds.Mar 5 2021, 5:28 AM
This revision was automatically updated to reflect the committed changes.