Skip to content

Commit 4ed3036

Browse files
committed
ci: make cpp-linter tidy-only and use pip-installed clang-tidy
Drop clang-format from the cpp-linter job (pre-commit already runs the pinned clang-format hook on every PR) and point --version at the setup-python bin dir so clang-tidy resolves to the pip-installed 22.1.8 instead of a system clang-tidy-22. Adds a temporary probe to exercise CI; will be dropped.
1 parent 46bf35e commit 4ed3036

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

‎.github/workflows/cpp-linter.yml‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ jobs:
4949
SCCACHE_DIR: ${{ github.workspace }}/.sccache
5050
SCCACHE_CACHE_SIZE: "2G"
5151
CPP_LINTER_VERSION: "1.13.0"
52-
# clang-format is kept in sync with .pre-commit-config.yaml; clang-tidy is
53-
# pinned separately because that version is not published on PyPI.
54-
CLANG_FORMAT_VERSION: "22.1.5"
52+
# clang-format is handled by the pre-commit workflow; cpp-linter runs
53+
# clang-tidy only.
5554
CLANG_TIDY_VERSION: "22.1.8"
5655
steps:
5756
- name: Checkout iceberg-cpp
@@ -104,7 +103,7 @@ jobs:
104103
if: github.event_name == 'pull_request'
105104
run: |
106105
python -m pip install --upgrade pip
107-
python -m pip install "cpp-linter==${CPP_LINTER_VERSION}" "clang-format==${CLANG_FORMAT_VERSION}" "clang-tidy==${CLANG_TIDY_VERSION}"
106+
python -m pip install "cpp-linter==${CPP_LINTER_VERSION}" "clang-tidy==${CLANG_TIDY_VERSION}"
108107
- name: Run cpp-linter
109108
id: linter
110109
if: github.event_name == 'pull_request'
@@ -114,9 +113,9 @@ jobs:
114113
# need '-fno-builtin-std-forward_like', see https://github.com/llvm/llvm-project/issues/101614
115114
run: |
116115
cpp-linter \
117-
--style=file \
116+
--style='' \
118117
--tidy-checks='' \
119-
--version="${CLANG_FORMAT_VERSION%%.*}" \
118+
--version="${pythonLocation}/bin" \
120119
--files-changed-only=true \
121120
--lines-changed-only=true \
122121
--thread-comments=true \

‎src/iceberg/temp_linter_probe.cc‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// TEMP verification file — will be dropped before merge.
2+
// Confirms cpp-linter runs clang-tidy with the pip-installed binary
3+
// (via --version=${pythonLocation}/bin) after dropping clang-format.
4+
namespace iceberg {
5+
6+
class TempLinterProbe {
7+
public:
8+
int* probe() {
9+
int* ptr = 0; // modernize-use-nullptr should flag this
10+
return ptr;
11+
}
12+
13+
private:
14+
int badMember; // readability-identifier-naming: missing trailing underscore
15+
};
16+
17+
} // namespace iceberg

0 commit comments

Comments
 (0)