This is an archive of the discontinued LLVM Phabricator instance.

run-clang-tidy: Report progress
Needs RevisionPublic

Authored by kfunk on Sep 5 2017, 8:17 AM.

Details

Summary

run-clang-tidy will now report the number of processed files as well as
the total number in the queue:

Example output:

[1/22] Running: clang-tidy -header-filter=^./.* -p=. .../src/icemon/src/fakemonitor.cc
[2/22] Running: clang-tidy -header-filter=^./.* -p=. .../src/icemon/src/hostinfo.cc
[3/22] Running: clang-tidy -header-filter=^./.* -p=. .../src/icemon/src/icecreammonitor.cc
[4/22] Running: clang-tidy -header-filter=^./.* -p=. .../src/icemon/src/job.cc

Event Timeline

kfunk created this revision.Sep 5 2017, 8:17 AM
kfunk edited the summary of this revision. (Show Details)Sep 5 2017, 8:32 AM

I think will be good idea to introduce command line option to control progress display: turn it off, show in absolute numbers or percents.

kfunk added a comment.Sep 5 2017, 3:55 PM

I think will be good idea to introduce command line option to control progress display: turn it off, show in absolute numbers or percents.

Honestly, I don't think this configurability is necessary. I'd like to keep that script here as simple as possible.

I'll wait for some more opinions.

It'll be also nice to output progress in terminal when all messages will saved into file.

alexfh requested changes to this revision.Sep 6 2017, 6:14 AM
alexfh added inline comments.
clang-tidy/tool/run-clang-tidy.py
155
  1. Can we have these messages printed on the same line when run in a terminal? Progress display is better when it doesn't fill the whole terminal scrollback. Changing '\n' to '\r' should be a good start, but we also need to insure reasonable interaction with other messages.
  1. The whole invocation may be quite a large line. Maybe just print the filename? (the rest would be repeated anyway)
This revision now requires changes to proceed.Sep 6 2017, 6:14 AM

I think CMake output is good model for run-clang-tidy.

This looks like a cool feature, why is it blocked?