esp-idf/tools/cmake/run_cmake_lint.sh
Ivan Grokhotkov e94288da31 global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs
Using the method from @cemeyer
(https://github.com/espressif/esp-idf/pull/3166):

find . -name \*.sh -exec sed -i "" -e 's|^#!.*bin/bash|#!/usr/bin/env bash|' {} +

Closes https://github.com/espressif/esp-idf/pull/3166.
2020-04-03 01:10:02 +02:00

26 lines
736 B
Bash
Executable File

#!/usr/bin/env 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
cd "$IDF_PATH"
# 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