Skip to content

Commit fc1e833

Browse files
authored
Fix cmake format for CMakeLists.txt (#1292)
1 parent eb21022 commit fc1e833

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.azure-pipelines-templates/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
displayName: 'Check Python code format'
3737
condition: succeededOrFailed()
3838
39-
- script: ./check-cmake-format.sh cmake samples src tests CMakeLists
39+
- script: ./check-cmake-format.sh cmake samples src tests CMakeLists.txt
4040
displayName: 'Check CMake code format'
4141
condition: succeededOrFailed()
4242

check-cmake-format.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ source env/bin/activate
3737
pip install cmake_format
3838

3939
unformatted_files=""
40-
for file in $(find "$@" -name "*.cmake"); do
40+
for file in $(find "$@" -name "*.cmake" -o -name "CMakeLists.txt"); do
4141
cmake-format --check "$file"
4242
d=$?
4343
if $fix ; then
@@ -52,7 +52,12 @@ for file in $(find "$@" -name "*.cmake"); do
5252
done
5353

5454
if [ "$unformatted_files" != "" ]; then
55-
echo "Fix formatting:"
55+
if $fix ; then
56+
echo "Formatted files:"
57+
else
58+
echo "Fix formatting:"
59+
fi
60+
5661
echo "$unformatted_files"
5762
exit 1
5863
else

0 commit comments

Comments
 (0)