[CI] add cmakelint to C++ linting task (#9641)
Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
This commit is contained in:
parent
0ecb4de963
commit
51e32e4905
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@ -141,7 +141,7 @@ jobs:
|
||||
architecture: 'x64'
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install wheel setuptools cpplint pylint
|
||||
python -m pip install wheel setuptools cmakelint cpplint pylint
|
||||
- name: Run lint
|
||||
run: |
|
||||
python3 tests/ci_build/lint_cpp.py xgboost cpp R-package/src
|
||||
@ -150,3 +150,5 @@ jobs:
|
||||
--exclude_path python-package/xgboost/dmlc-core python-package/xgboost/include \
|
||||
python-package/xgboost/lib python-package/xgboost/rabit \
|
||||
python-package/xgboost/src
|
||||
|
||||
sh ./tests/ci_build/lint_cmake.sh || true
|
||||
|
||||
14
tests/ci_build/lint_cmake.sh
Normal file
14
tests/ci_build/lint_cmake.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cmake_files=$(
|
||||
find . -name CMakeLists.txt -o -path "./cmake/*.cmake" \
|
||||
| grep -v dmlc-core \
|
||||
| grep -v gputreeshap
|
||||
)
|
||||
cmakelint \
|
||||
--linelength=120 \
|
||||
--filter=-convention/filename,-package/stdargs,-readability/wonkycase \
|
||||
${cmake_files} \
|
||||
|| exit 1
|
||||
Loading…
x
Reference in New Issue
Block a user