From 61c0fb22bc417c6a9c5efe4a70b70258d5c11ee2 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 31 Aug 2025 16:51:55 +0300 Subject: [PATCH 1/2] feat: support clang-tidy==21.1.0 --- README.md | 4 ++-- cpp_linter_hooks/util.py | 1 + pyproject.toml | 2 +- testing/pre-commit-config-version.yaml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 21cfb5a..de2001b 100644 --- a/README.md +++ b/README.md @@ -154,10 +154,10 @@ Use -header-filter=.* to display errors from all non-system headers. Use -system rev: v1.1.0 hooks: - id: clang-format - args: [--style=file, --version=20] + args: [--style=file, --version=21] files: ^(src|include)/.*\.(cpp|cc|cxx|h|hpp)$ # Limits to specific dirs and file types - id: clang-tidy - args: [--checks=.clang-tidy, --version=20] + args: [--checks=.clang-tidy, --version=21] files: ^(src|include)/.*\.(cpp|cc|cxx|h|hpp)$ ``` diff --git a/cpp_linter_hooks/util.py b/cpp_linter_hooks/util.py index ec24431..80f9b34 100644 --- a/cpp_linter_hooks/util.py +++ b/cpp_linter_hooks/util.py @@ -119,6 +119,7 @@ def get_version_from_dependency(tool: str) -> Optional[str]: "19.1.0", "19.1.0.1", "20.1.0", + "21.1.0", ] diff --git a/pyproject.toml b/pyproject.toml index 1d8162a..5665823 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ tracker = "https://github.com/cpp-linter/cpp-linter-hooks/issues" # only clang tools can added to this section to make hooks work tools = [ "clang-format==21.1.0", - "clang-tidy==20.1.0", + "clang-tidy==21.1.0", ] dev = [ diff --git a/testing/pre-commit-config-version.yaml b/testing/pre-commit-config-version.yaml index 16573f4..b8ca807 100644 --- a/testing/pre-commit-config-version.yaml +++ b/testing/pre-commit-config-version.yaml @@ -40,4 +40,4 @@ repos: - id: clang-format args: [--style=file, --version=21] - id: clang-tidy - args: [--checks=.clang-tidy, --version=20] # clang-tidy does not support version 21 + args: [--checks=.clang-tidy, --version=21] # clang-tidy does not support version 21 From f27eeddd191464528e8c74287285f2ac1fed8d78 Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Sun, 31 Aug 2025 20:52:26 +0300 Subject: [PATCH 2/2] Update testing/pre-commit-config-version.yaml --- testing/pre-commit-config-version.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/pre-commit-config-version.yaml b/testing/pre-commit-config-version.yaml index b8ca807..f00095d 100644 --- a/testing/pre-commit-config-version.yaml +++ b/testing/pre-commit-config-version.yaml @@ -40,4 +40,4 @@ repos: - id: clang-format args: [--style=file, --version=21] - id: clang-tidy - args: [--checks=.clang-tidy, --version=21] # clang-tidy does not support version 21 + args: [--checks=.clang-tidy, --version=21]