]> granicus.if.org Git - esp-idf/blob - tools/cmake/run_cmake_lint.sh
cmake: Fix COMPONENT_SRCEXCLUDE functionality
[esp-idf] / tools / cmake / run_cmake_lint.sh
1 #!/bin/bash
2 #
3 # Run cmakelint on all cmake files in IDF_PATH (except third party)
4 #
5 # cmakelint: https://github.com/richq/cmake-lint
6 #
7 # NOTE: This script makes use of features in (currently unreleased)
8 # cmakelint >1.4. Install directly from github as follows:
9 #
10 # pip install https://github.com/richq/cmake-lint/archive/058c6c0ed2536.zip
11 #
12
13 if [ -z "${IDF_PATH}" ]; then
14     echo "IDF_PATH variable needs to be set"
15     exit 3
16 fi
17
18 # Only list the "main" IDF repo, don't check any files in submodules (which may contain
19 # third party CMakeLists.txt)
20  git ls-tree --full-tree --name-only -r HEAD | grep -v "/third_party/" | grep "CMakeLists.txt\|\.cmake$" \
21     | xargs cmakelint --linelength=120 --spaces=4
22
23