OVMS3-idf/tools/cmake/run_cmake_lint.sh
2018-05-31 14:46:23 +10:00

23 lines
710 B
Bash
Executable file

#!/bin/bash
#
# Run cmakelint on all cmake files in IDF_PATH (except third party)
#
# cmakelint: https://github.com/richq/cmake-lint
#
# NOTE: This script makes use of features in (currently unreleased)
# cmakelint >1.4. Install directly from github as follows:
#
# pip install https://github.com/richq/cmake-lint/archive/058c6c0ed2536.zip
#
if [ -z "${IDF_PATH}" ]; then
echo "IDF_PATH variable needs to be set"
exit 3
fi
# Only list the "main" IDF repo, don't check any files in submodules (which may contain
# third party CMakeLists.txt)
git ls-tree --full-tree --name-only -r HEAD | grep -v "/third_party/" | grep "CMakeLists.txt\|\.cmake$" \
| xargs cmakelint --linelength=120 --spaces=4