[all-commits] [llvm/llvm-project] 2b87d0: [clang-tidy] Properly escape printed clang-tidy co...

Thorsten Klein via All-commits all-commits at lists.llvm.org
Wed Apr 1 13:36:02 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b87d02b035b97940474d0b3b27f3dcdb8934623
      https://github.com/llvm/llvm-project/commit/2b87d02b035b97940474d0b3b27f3dcdb8934623
  Author: Thorsten Klein <thorsten.klein at bshg.com>
  Date:   2026-04-01 (Wed, 01 Apr 2026)

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

  Log Message:
  -----------
  [clang-tidy] Properly escape printed clang-tidy command in `run-clang-tidy.py` (#189974)

The `run-clang-tidy.py` script now uses `shlex.join()` to construct the
command string for printing.

This ensures that arguments containing shell metacharacters, such as the
asterisk in `--warnings-as-errors=*`, are correctly quoted. This allows
the command to be safely copied and pasted into any shell for manual
execution, fixing errors previously seen with shells like `fish` that
are strict about wildcard expansion.

Before:
```
[ 1/15][0.2s] /usr/bin/clang-tidy -p=/home/user/work/project/build --warnings-as-errors=* /home/user/work/project/src/main.cpp
```

Note: When running this command in fish shell you get some error like
`fish: No matches for wildcard '--warnings-as-errors=*'. See `help
wildcards-globbing``

After:
```
[ 1/15][0.2s] /usr/bin/clang-tidy -p=/home/user/work/project/build '--warnings-as-errors=*' /home/user/work/project/src/main.cpp
```



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