Skip to content

Commit faa8a9a

Browse files
authored
Support clang tools version 16 (#45)
* feat: support clang-tools version 16 * fix: test workflow and README.md
1 parent 5987669 commit faa8a9a

File tree

6 files changed

+25
-22
lines changed

6 files changed

+25
-22
lines changed

.github/workflows/python-test.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
needs: [build]
5353
strategy:
5454
matrix:
55-
version: [ 3.9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12.0.1, 13, 14, 15 ]
55+
version: [ 3.9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12.0.1, 13, 14, 15, 16 ]
5656
os: [ ubuntu-latest, macos-latest, windows-latest ]
5757
fail-fast: false
5858
runs-on: ${{ matrix.os }}
@@ -110,11 +110,14 @@ jobs:
110110
clang-tidy-12 --version
111111
else
112112
clang-format-${{ matrix.version }} --version
113-
if [ "${{ matrix.version }}" = "14" -o "${{ matrix.version }}" = "15" ]; then
114-
echo "skip version ${{ matrix.version }} because Segmentation fault on ubuntu."
115-
else
116-
clang-tidy-${{ matrix.version }} --version
117-
fi
113+
case "${{ matrix.version }}" in
114+
14|15|16)
115+
echo "Skipping version ${{ matrix.version }} due to Segmentation fault on Ubuntu."
116+
;;
117+
*)
118+
clang-tidy-${{ matrix.version }} --version
119+
;;
120+
esac
118121
fi
119122
120123
docs:

README.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,27 @@ Supported versions
124124
clang-format
125125
************
126126
.. csv-table::
127-
:header: "Version", "15", "14", "13", "12", "11", "10", "9", "8", "7", "6", "5", "4", "3.9"
127+
:header: "Version", "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", "15", "14", "13", "12", "11", "10", "9", "8", "7", "6", "5", "4", "3.9"
137+
:header: "Version", "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

146-
1. clang-tidy-14 and clang-tidy-15 has Segmentation fault on Ubuntu 22.02.
147-
2. clang-tidy-14 and clang-tidy-15 is over 1 GB for MacOSX
146+
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
148148

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

clang_tools/install.py

Lines changed: 1 addition & 1 deletion
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-1d7ec53d"
66+
tool: str, version: str, release_tag: str = "master-9ba48406"
6767
) -> str:
6868
"""Assemble the URL to the binary.
6969

tests/test_install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
)
1414

1515

16-
@pytest.mark.parametrize("version", [str(v) for v in range(7, 14)] + ["12.0.1"])
16+
@pytest.mark.parametrize("version", [str(v) for v in range(7, 17)] + ["12.0.1"])
1717
@pytest.mark.parametrize("tool_name", ["clang-format", "clang-tidy"])
1818
def test_clang_tools_binary_url(tool_name: str, version: str):
1919
"""Test `clang_tools_binary_url()`"""
@@ -50,7 +50,7 @@ def test_create_symlink(monkeypatch: pytest.MonkeyPatch, tmp_path: Path):
5050
assert not create_sym_link(tool_name, version, str(tmp_path), True)
5151

5252

53-
@pytest.mark.parametrize("version", [str(v) for v in range(10, 14)] + ["12.0.1"])
53+
@pytest.mark.parametrize("version", [str(v) for v in range(10, 17)] + ["12.0.1"])
5454
def test_install_tools(monkeypatch: pytest.MonkeyPatch, tmp_path: Path, version: str):
5555
"""Test install tools to a temp directory."""
5656
monkeypatch.chdir(tmp_path)

tests/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def parser() -> ArgumentParser:
2323

2424

2525
@pytest.mark.parametrize("arg_name", ["install", "directory", "uninstall"])
26-
@pytest.mark.parametrize("arg_value", [str(v) for v in range(7, 14)] + ["12.0.1"])
26+
@pytest.mark.parametrize("arg_value", [str(v) for v in range(7, 17)] + ["12.0.1"])
2727
def test_arg_parser(arg_name: str, arg_value: str, parser: ArgumentParser):
2828
"""Test CLI arg parsing using a set of fake args."""
2929
args = parser.parse_args([f"--{arg_name}={arg_value}"])

tests/test_util.py

Lines changed: 2 additions & 2 deletions
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-1d7ec53d", pytest.param("latest", marks=pytest.mark.xfail)]
16+
"tag", ["master-9ba48406", 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-1d7ec53d")
33+
url = clang_tools_binary_url("clang-query", "12", release_tag="master-9ba48406")
3434
assert get_sha_checksum(url) == expected

0 commit comments

Comments
 (0)