Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .cmakelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# build and install are separated so changes to build don't invalidate
# the whole docker cache for the image

# --filter= options: https://pypi.org/project/cmakelint/
# "-" disable option
# "+" enable option
filter=-convention/filename,-linelength,-package/consistency,-readability/logic,-readability/mixedcase,-readability/wonkycase,-syntax,-whitespace/eol,+whitespace/extra,-whitespace/indent,-whitespace/mismatch,-whitespace/newline,-whitespace/tabs
3 changes: 3 additions & 0 deletions ci/docker/install/requirements
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ h5py==2.10.0
# Array API Standardization requirements
hypothesis==6.14.0

# Static code checker for CMake files
cmakelint==1.4.1

# Prospector - Python Static Analysis
prospector==1.5.1

Expand Down
7 changes: 7 additions & 0 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,18 @@ sanity_check() {
set -ex
sanity_clang
sanity_license
sanity_cmakelint
sanity_tutorial
sanity_python_prospector
sanity_cpp
}

sanity_cmakelint() {
set -exu

git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | grep -E -z -v '^(3rdparty)|cmake/Modules/|cmake/upstream/' | xargs -0 cmakelint --config=.cmakelintrc --quiet
}

sanity_tutorial() {
set -ex
export DMLC_LOG_STACK_TRACE_DEPTH=100
Expand Down