Skip to content

Commit e791e9a

Browse files
test: extend version tests to include v22 (16–22)
Agent-Logs-Url: https://github.com/cpp-linter/cpp-linter-hooks/sessions/4d67c252-ccfb-4ba3-ae46-d69b30392b7d Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
1 parent 339d642 commit e791e9a

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

testing/pre-commit-config-version.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,10 @@ repos:
4141
args: [--style=file, --version=21]
4242
- id: clang-tidy
4343
args: [--checks=.clang-tidy, --version=21]
44+
- repo: .
45+
rev: HEAD
46+
hooks:
47+
- id: clang-format
48+
args: [--style=file, --version=22]
49+
- id: clang-tidy
50+
args: [--checks=.clang-tidy, --version=22]

testing/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ run_test \
5959
"testing/main.c" \
6060
"true"
6161

62-
# ── Version config: explicit versions 16–21 ──────────────────────────────────
62+
# ── Version config: explicit versions 16–22 ──────────────────────────────────
6363
# Expected: at least clang-format v16 rewrites the file → failure reported.
6464
run_test \
65-
"versions 16-21: clang-format + clang-tidy" \
65+
"versions 16-22: clang-format + clang-tidy" \
6666
"testing/pre-commit-config-version.yaml" \
6767
"testing/main.c" \
6868
"true"

tests/test_integration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
for the key scenarios exercised by the pre-commit configuration files:
55
66
* pre-commit-config.yaml – basic style-from-file with .clang-format
7-
* pre-commit-config-version.yaml – explicit tool versions 16–21
7+
* pre-commit-config-version.yaml – explicit tool versions 16–22
88
* pre-commit-config-verbose.yaml – --verbose / -v flags
99
* pre-commit-config-style.yaml – LLVM, Google, Microsoft, WebKit, Mozilla, Chromium
1010
@@ -88,12 +88,12 @@ def test_clang_format_style_from_file_is_idempotent(clang_format_workspace):
8888

8989

9090
# ---------------------------------------------------------------------------
91-
# pre-commit-config-version.yaml scenario – explicit versions 16–21
91+
# pre-commit-config-version.yaml scenario – explicit versions 16–22
9292
# ---------------------------------------------------------------------------
9393

9494

9595
@pytest.mark.benchmark
96-
@pytest.mark.parametrize("version", ["16", "17", "18", "19", "20", "21"])
96+
@pytest.mark.parametrize("version", ["16", "17", "18", "19", "20", "21", "22"])
9797
def test_clang_format_style_from_file_with_version(tmp_path, monkeypatch, version):
9898
"""--style=file combined with an explicit --version reformats the file."""
9999
shutil.copy(TESTING_DIR / ".clang-format", tmp_path / ".clang-format")

0 commit comments

Comments
 (0)