[clang-tidy] Install run-clang-tidy.py in bin/ as run-clang-tidy

The run-clang-tidy.py helper script is supposed to be used by the
user, hence it should be placed in the user's PATH. Some
distributions, like Gentoo [1], won't have it in PATH unless it is
installed in bin/.

Furthermore, installed scripts in PATH usually do not carry a filename
extension, since there is no need to know that this is a Python
script. For example Debian and Ubuntu already install this script as
'run-clang-tidy' [2] and hence build systems like Meson also look for
this name first [3]. Hence we install run-clang-tidy.py as
run-clang-tidy, as suggested by Sylvestre Ledru [4].

1: https://bugs.gentoo.org/753380
2: 60aefb1417/debian/clang-tidy-X.Y.links.in (L2)
3: b6dc4d5e5c/mesonbuild/scripts/clangtidy.py (L44)
4: https://reviews.llvm.org/D90972#2380640

Reviewed By: sylvestre.ledru, JonasToth

Differential Revision: https://reviews.llvm.org/D90972
This commit is contained in:
Florian Schmaus 2021-02-23 12:38:11 +00:00 committed by Nathan James
parent 633e090528
commit 6c78711f10
No known key found for this signature in database
GPG Key ID: CC007AFCDA90AA5F
2 changed files with 6 additions and 2 deletions

View File

@ -55,5 +55,6 @@ install(PROGRAMS clang-tidy-diff.py
DESTINATION share/clang
COMPONENT clang-tidy)
install(PROGRAMS run-clang-tidy.py
DESTINATION share/clang
COMPONENT clang-tidy)
DESTINATION bin
COMPONENT clang-tidy
RENAME run-clang-tidy)

View File

@ -67,6 +67,9 @@ The improvements are...
Improvements to clang-tidy
--------------------------
- The `run-clang-tidy.py` helper script is now installed in `bin/` as
`run-clang-tidy`. It was previously installed in `share/clang/`.
New checks
^^^^^^^^^^