diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8065885a99..72d45b7661 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -70,7 +70,6 @@ repos: entry: ./cpp/scripts/run-cmake-format.sh cmake-format language: python types: [cmake] - #exclude: .*/thirdparty/.* # Note that pre-commit autoupdate does not update the versions # of dependencies, so we'll have to update this manually. additional_dependencies: @@ -82,7 +81,6 @@ repos: entry: ./cpp/scripts/run-cmake-format.sh cmake-lint language: python types: [cmake] - #exclude: .*/thirdparty/.* # Note that pre-commit autoupdate does not update the versions # of dependencies, so we'll have to update this manually. additional_dependencies: diff --git a/cpp/scripts/run-cmake-format.sh b/cpp/scripts/run-cmake-format.sh index b7f7b190c3..39e0346461 100755 --- a/cpp/scripts/run-cmake-format.sh +++ b/cpp/scripts/run-cmake-format.sh @@ -48,7 +48,7 @@ DEFAULT_FORMAT_FILE_LOCATIONS=( ) if [ -z ${RAPIDS_CMAKE_FORMAT_FILE:+PLACEHOLDER} ]; then - for file_path in ${DEFAULT_FORMAT_FILE_LOCATIONS[@]}; do + for file_path in "${DEFAULT_FORMAT_FILE_LOCATIONS[@]}"; do if [ -f ${file_path} ]; then RAPIDS_CMAKE_FORMAT_FILE=${file_path} break @@ -68,12 +68,12 @@ else fi if [[ $1 == "cmake-format" ]]; then - cmake-format -i --config-files cpp/cmake/config.json ${RAPIDS_CMAKE_FORMAT_FILE} -- ${@:2} + cmake-format -i --config-files cpp/cmake/config.json ${RAPIDS_CMAKE_FORMAT_FILE} -- "${@:2}" elif [[ $1 == "cmake-lint" ]]; then # Since the pre-commit hook is verbose, we have to be careful to only # present cmake-lint's output (which is quite verbose) if we actually # observe a failure. - OUTPUT=$(cmake-lint --config-files cpp/cmake/config.json ${RAPIDS_CMAKE_FORMAT_FILE} -- ${@:2}) + OUTPUT=$(cmake-lint --config-files cpp/cmake/config.json ${RAPIDS_CMAKE_FORMAT_FILE} -- "${@:2}") status=$? if ! [ ${status} -eq 0 ]; then