[CI] add cmakelint to C++ linting task (#9641)

Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
This commit is contained in:
James Lamb
2023-10-11 03:04:10 -05:00
committed by GitHub
parent 0ecb4de963
commit 51e32e4905
2 changed files with 17 additions and 1 deletions

View 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