Skip to content

Commit d3d6979

Browse files
committed
feat: support clang v21
1 parent 924f4de commit d3d6979

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -14,7 +14,7 @@ repos:
1414
hooks:
1515
- id: pyupgrade
1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.12.2
17+
rev: v0.12.11
1818
hooks:
1919
- id: ruff
2020
- id: ruff-format

cpp_linter_hooks/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def get_version_from_dependency(tool: str) -> Optional[str]:
102102
"20.1.4",
103103
"20.1.5",
104104
"20.1.6",
105-
"20.1.7",
105+
"20.1.8",
106+
"21.1.0",
106107
]
107108

108109
CLANG_TIDY_VERSIONS = [

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ tracker = "https://github.com/cpp-linter/cpp-linter-hooks/issues"
4848
[project.optional-dependencies]
4949
# only clang tools can added to this section to make hooks work
5050
tools = [
51-
"clang-format==20.1.7",
51+
"clang-format==21.1.0",
5252
"clang-tidy==20.1.0",
5353
]
5454

tests/test_clang_format.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
(["--style=Google", "--version=18"], (0, "")),
1515
(["--style=Google", "--version=19"], (0, "")),
1616
(["--style=Google", "--version=20"], (0, "")),
17+
(["--style=Google", "--version=21"], (0, "")),
1718
),
1819
)
1920
def test_run_clang_format_valid(args, expected_retval, tmp_path):
@@ -40,6 +41,7 @@ def test_run_clang_format_valid(args, expected_retval, tmp_path):
4041
(["--style=Google", "--version=18"], 1),
4142
(["--style=Google", "--version=19"], 1),
4243
(["--style=Google", "--version=20"], 1),
44+
(["--style=Google", "--version=21"], 1),
4345
),
4446
)
4547
def test_run_clang_format_invalid(args, expected_retval, tmp_path):

tests/test_clang_tidy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def generate_compilation_database():
2222
(['--checks="boost-*"', "--version=18"], 1),
2323
(['--checks="boost-*"', "--version=19"], 1),
2424
(['--checks="boost-*"', "--version=20"], 1),
25+
(['--checks="boost-*"', "--version=21"], 1),
2526
),
2627
)
2728
def test_run_clang_tidy_valid(args, expected_retval):
@@ -43,6 +44,7 @@ def test_run_clang_tidy_valid(args, expected_retval):
4344
(['--checks="boost-*"', "--version=18"], 1),
4445
(['--checks="boost-*"', "--version=19"], 1),
4546
(['--checks="boost-*"', "--version=20"], 1),
47+
(['--checks="boost-*"', "--version=21"], 1),
4648
),
4749
)
4850
def test_run_clang_tidy_invalid(args, expected_retval, tmp_path):

tests/test_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ def test_get_version_from_dependency_malformed_toml():
165165
"user_input,expected",
166166
[
167167
(None, None),
168-
("20", "20.1.7"), # Should find latest 20.x
169-
("20.1", "20.1.7"), # Should find latest 20.1.x
168+
("20", "20.1.8"), # Should find latest 20.x
169+
("20.1", "20.1.8"), # Should find latest 20.1.x
170170
("20.1.7", "20.1.7"), # Exact match
171171
("18", "18.1.8"), # Should find latest 18.x
172172
("18.1", "18.1.8"), # Should find latest 18.1.x

0 commit comments

Comments
 (0)