File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ cd "$SCRIPT_DIR"
1919
2020UNCRUSTIFY_VERSION=" 0.80.1"
2121UNCRUSTIFY=" ${UNCRUSTIFY-uncrustify} "
22+ UNCRUSTIFY_CONFIG=" ${SCRIPT_DIR} /.uncrustify.cfg"
2223
2324err () { echo -e >&2 " ERROR: $@ \n" ; }
2425die () { err $@ ; exit 1; }
@@ -36,9 +37,12 @@ if [[ "$DETECTED_VERSION" != "${UNCRUSTIFY_VERSION}" ]]; then
3637 die " Expected Uncrustify ${UNCRUSTIFY_VERSION} ."
3738fi
3839
40+ # Config check
41+ [[ -f " $UNCRUSTIFY_CONFIG " ]] || die " Uncrustify config not found at: $UNCRUSTIFY_CONFIG "
42+
3943# Run formatter
4044echo " Running formatter..."
41- $UNCRUSTIFY -c .uncrustify.cfg -l CPP --no-backup --replace * .cpp * .h
45+ $UNCRUSTIFY -c " $UNCRUSTIFY_CONFIG " -l CPP --no-backup --replace * .cpp * .h
4246
4347# Show diff and fail if changes exist
4448echo " Checking for formatting changes..."
You can’t perform that action at this time.
0 commit comments