Skip to content
Snippets Groups Projects
Verified Commit 3a7adca8 authored by rahix's avatar rahix
Browse files

fix(code-style.sh): Warn on non-C files


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent f3b26e8a
No related branches found
No related tags found
No related merge requests found
Pipeline #1395 passed
...@@ -12,7 +12,7 @@ if ! command -v python3 >/dev/null 2>&1; then ...@@ -12,7 +12,7 @@ if ! command -v python3 >/dev/null 2>&1; then
exit 127 exit 127
fi fi
if [ "$#" == 0 ]; then if [[ "$#" == 0 ]]; then
echo "usage: $0 <source.c> ..." echo "usage: $0 <source.c> ..."
exit 1 exit 1
fi fi
...@@ -20,7 +20,12 @@ fi ...@@ -20,7 +20,12 @@ fi
script_dir="$(dirname "$0")" script_dir="$(dirname "$0")"
for source_file in "$@"; do for source_file in "$@"; do
echo "Formatting $source_file ..." if [[ "$source_file" == *.c ]]; then
clang-format -i "$source_file" echo "Formatting $source_file ..."
python3 "$script_dir/fix-multi-decl.py" "$source_file" clang-format -i "$source_file"
python3 "$script_dir/fix-multi-decl.py" "$source_file"
else
echo "Not a C file: $source_file" >&2
continue
fi
done done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment