Skip to content
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,12 @@ Otherwise, [nushell] and/or the LLVM-provided bash script will fail to run.
### On macOS runners

The specified `version` of `clang-format` and `clang-tidy` is installed via Homebrew.
Failing that, we attempt to use static binaries that we built ourselves;
see [cpp-linter/clang-tools-pip] and [cpp-linter/clang-tools-static-binaries] projects for more detail.
Failing that, we attempt to use Python wheel that we built ourselves; see [cpp-linter/clang-tools-pip] project for more detail.

### On Windows runners

For Windows runners, we only use clang tools built as static binaries.
See [cpp-linter/clang-tools-pip] and [cpp-linter/clang-tools-static-binaries] projects for more detail.
For Windows runners, we only use clang tools Python wheels.
See [cpp-linter/clang-tools-pip] project for more detail.

## License

Expand All @@ -203,7 +202,6 @@ The scripts and documentation in this project are released under the [MIT Licens
[nushell]: https://www.nushell.sh/
[uv]: https://docs.astral.sh/uv/
[cpp-linter/clang-tools-pip]: https://github.com/cpp-linter/clang-tools-pip
[cpp-linter/clang-tools-static-binaries]: https://github.com/cpp-linter/clang-tools-static-binaries
[gh-container-syntax]: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idcontainer

<!--README-end-->
14 changes: 9 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ inputs:
description: |
The desired version of the [clang-tools](https://github.com/cpp-linter/clang-tools-pip) to use.
Accepted options are strings which can be 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10 or 9.
clang-tidy only supports versions 13 and above.

- Set this option to a blank string (`''`) to use the platform's default installed version.
- This value can also be a path to where the clang tools are installed (if using a custom install location).
Expand Down Expand Up @@ -377,12 +378,15 @@ runs:
^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args

print $"\n(ansi purple)Ensuring clang-format and clang-tidy ${{ inputs.version }} are present(ansi reset)"
let cmd = [clang-tools -i ${{ inputs.version }} -b]
$uv_args = [run --no-sync --project $action_path --directory (pwd)]
if $verbosity {
$uv_args = $uv_args | append '-v'
let tools = ['clang-format' 'clang-tidy']
for tool in $tools {
let cmd = [clang-tools-wheel --tool $tool --version ${{ inputs.version }}]
$uv_args = [run --no-sync --project $action_path --directory (pwd)]
if $verbosity {
$uv_args = $uv_args | append '-v'
}
^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args ...$cmd
}
^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args ...$cmd

- name: Run cpp-linter
id: cpp-linter
Expand Down
Loading