[all-commits] [llvm/llvm-project] 315561: [run-clang-tidy.py] Refactor, add progress indicat...

Nicolas van Kempen via All-commits all-commits at lists.llvm.org
Mon Jul 22 11:24:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 315561c867784ebd9ca387e94ea6597918e7cc1c
      https://github.com/llvm/llvm-project/commit/315561c867784ebd9ca387e94ea6597918e7cc1c
  Author: Nicolas van Kempen <nvankemp at gmail.com>
  Date:   2024-07-22 (Mon, 22 Jul 2024)

  Changed paths:
    M clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
    M clang-tools-extra/docs/ReleaseNotes.rst

  Log Message:
  -----------
  [run-clang-tidy.py] Refactor, add progress indicator, add type hints (#89490)

[There is
work](https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-python-version/67571)
to make Python 3.8 the minimum Python version for LLVM.

I edited this script because I wanted some indicator of progress while
going through files.
It now outputs `[XX/YYY]` with the number of processed and total files
after each completion.

The current version of this script is compatible downto Python 3.6 (this
is PyYAML's minimum version).
It would probably work with older Python 3 versions with an older PyYAML
or when YAML is disabled.

With the updates here, it is compatible downto Python 3.7. Python 3.7
was released June 2018.

https://github.com/llvm/llvm-project/pull/89302 is also touching this
file, I don't mind rebasing on top of that work if needed.

### Summary

 -  Add type annotations.
 -  Replace `threading` + `queue` with `asyncio`.
- **Add indicator of processed files over total files**. This is what I
set out to do initially.
- Only print the filename after completion, not the entire Clang-Tidy
invocation command. I find this neater but the behavior can easily be
restored.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list