Skip to content

Commit 7df9e4c

Browse files
authored
Support clang tools version 17 (#48)
1 parent b593836 commit 7df9e4c

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

.github/workflows/python-test.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
needs: [build]
6161
strategy:
6262
matrix:
63-
version: [ 3.9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12.0.1, 13, 14, 15, 16 ]
63+
version: [ 3.9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12.0.1, 13, 14, 15, 16, 17 ]
6464
os: [ ubuntu-latest, macos-latest, windows-latest ]
6565
fail-fast: false
6666
runs-on: ${{ matrix.os }}
@@ -87,35 +87,35 @@ jobs:
8787
- name: Show path of binaries
8888
shell: bash
8989
run: |
90-
if [ "${{ matrix.version }}" = "15" -a "${{ matrix.os }}" = "windows-latest" ]; then
91-
which clang-format
92-
which clang-tidy
93-
elif [ "${{ matrix.version }}" = "12.0.1" -a "${{ matrix.os }}" = "ubuntu-latest" ]; then
94-
which clang-format-12
95-
which clang-tidy-12
96-
else
97-
which clang-format-${{ matrix.version }}
98-
which clang-tidy-${{ matrix.version }}
90+
if [ "${{ matrix.version }}" = "15" -o "${{ matrix.version }}" = "16" ] && [ "${{ matrix.os }}" = "windows-latest" ]; then
91+
which clang-format
92+
which clang-tidy
93+
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
94+
which "clang-format-${{ matrix.version }}"
95+
which "clang-tidy-${{ matrix.version }}"
9996
fi
10097
10198
- name: Check clang-tools on Windows
10299
if: matrix.os == 'windows-latest'
103100
shell: bash
104101
run: |
105-
if [ "${{ matrix.version }}" = "15" ]; then
106-
clang-format.exe --version
107-
clang-tidy.exe --version
108-
else
109-
clang-format-${{ matrix.version }}.exe --version
110-
clang-tidy-${{ matrix.version }}.exe --version
111-
fi
102+
case "${{ matrix.version }}" in
103+
15|16)
104+
clang-format.exe --version
105+
clang-tidy.exe --version
106+
;;
107+
*)
108+
clang-format-${{ matrix.version }}.exe --version
109+
clang-tidy-${{ matrix.version }}.exe --version
110+
;;
111+
esac
112112
113113
- name: Check clang-tools on Unix
114114
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
115115
run: |
116116
if [ "${{ matrix.version }}" = "12.0.1" -a "${{ matrix.os }}" = "ubuntu-latest" ]; then
117-
clang-format-12 --version
118-
clang-tidy-12 --version
117+
clang-format-12.0.1 --version
118+
clang-tidy-12.0.1 --version
119119
else
120120
clang-format-${{ matrix.version }} --version
121121
case "${{ matrix.version }}" in

README.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,27 @@ Supported versions
124124
clang-format
125125
************
126126
.. csv-table::
127-
:header: "Version", "16", "15", "14", "13", "12", "11", "10", "9", "8", "7", "6", "5", "4", "3.9"
127+
:header: "Version", "17", "16", "15", "14", "13", "12", "11", "10", "9", "8", "7", "6", "5", "4", "3.9"
128128
:stub-columns: 1
129129

130-
Linux,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
131-
Windows,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
132-
macOS,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
130+
Linux,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
131+
Windows,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
132+
macOS,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
133133

134134
clang-tidy
135135
**********
136136
.. csv-table::
137-
:header: "Version", "16", "15", "14", "13", "12", "11", "10", "9", "8", "7", "6", "5", "4", "3.9"
137+
:header: "Version", "17", "16", "15", "14", "13", "12", "11", "10", "9", "8", "7", "6", "5", "4", "3.9"
138138
:stub-columns: 1
139139

140-
Linux,❌,❌,❌,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
141-
Windows,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
142-
macOS,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
140+
Linux,✔️,❌,❌,❌,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
141+
Windows,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
142+
macOS,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️,✔️
143143

144144
Know issues:
145145

146146
1. clang-tidy-14, clang-tidy-15 and clang-tidy-16 has Segmentation fault on Ubuntu 22.02.
147-
2. clang-tidy-14, clang-tidy-15 and clang-tidy-16 is over 1 GB for MacOSX
147+
2. clang-tidy-14, clang-tidy-15, clang-tidy-16, clang-tidy-17 is over 1 GB for MacOSX
148148

149149
Thanks to the project
150150
`clang-tools-static-binaries <https://github.com/muttleyxd/clang-tools-static-binaries>`_

clang_tools/install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def is_installed(tool_name: str, version: str) -> Optional[Path]:
6363

6464

6565
def clang_tools_binary_url(
66-
tool: str, version: str, release_tag: str = "master-9ba48406"
66+
tool: str, version: str, release_tag: str = "master-8f72ab3c"
6767
) -> str:
6868
"""Assemble the URL to the binary.
6969
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bd1492a81d05d5fa13457e11b75b73bf4a02213b14daf2a956dc7413b0cf1f47de4c4e96e15139a09cdaae1152d47b5dd9cab43fdbe993d58161636ca2e8a33e clang-query-12_linux-amd64
1+
02c62a5916e669bff34a2777874912a0e84556df448b7c690b4e9fe3e429dd29e0b8195124cc3e1b16b0ee3271391c865c040707d32c9ccfc45737a5673fc385 clang-query-12_linux-amd64

tests/test_util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_check_install_os():
1313

1414

1515
@pytest.mark.parametrize(
16-
"tag", ["master-9ba48406", pytest.param("latest", marks=pytest.mark.xfail)]
16+
"tag", ["master-8f72ab3c", pytest.param("latest", marks=pytest.mark.xfail)]
1717
)
1818
def test_download_file(monkeypatch: pytest.MonkeyPatch, tmp_path: Path, tag: str):
1919
"""Test that deliberately fails to download a file."""
@@ -30,5 +30,5 @@ def test_get_sha(monkeypatch: pytest.MonkeyPatch):
3030
expected = Path(f"clang-query-12_{install_os}-amd64.sha512sum").read_text(
3131
encoding="utf-8"
3232
)
33-
url = clang_tools_binary_url("clang-query", "12", release_tag="master-9ba48406")
33+
url = clang_tools_binary_url("clang-query", "12", release_tag="master-8f72ab3c")
3434
assert get_sha_checksum(url) == expected

0 commit comments

Comments
 (0)