diff --git a/AfRApay.MateCard/README.md b/AfRApay.MateCard/README.md index d851ca5..b9cec47 100644 --- a/AfRApay.MateCard/README.md +++ b/AfRApay.MateCard/README.md @@ -7,4 +7,4 @@ This project uses PlatformIO. Quick setup guide: - To compile, run `pio run` - To compile and upload, run `pio run -t upload` - To run clang-tidy, run `pio check`. -- Please run `uncrustify --no-backup -c .uncrustify.cfg src/*.cpp include/*.h` before commiting. To install it as a pre-commit hook, run `ln -s ../../hooks/pre-commit.hook ../.git/hooks/pre-commit` in this directory. +- Please run `./scripts/uncrustify.sh` before commiting. To install it as a pre-commit hook, run `ln -s ../../hooks/pre-commit.hook ../.git/hooks/pre-commit` in this directory. diff --git a/scripts/uncrustify.sh b/scripts/uncrustify.sh new file mode 100644 index 0000000..41b1cf1 --- /dev/null +++ b/scripts/uncrustify.sh @@ -0,0 +1,6 @@ +#!/bin/bash +script=$(realpath "$0") +scripts_root=$(dirname "$script") +project_root=$(dirname "$scripts_root") +tgt="$project_root/AfRApay.MateCard" +find "$tgt" -type f -path "$tgt/src/*.cpp" -or -path "$tgt/include/*.h" | uncrustify --no-backup -c "$tgt/.uncrustify.cfg" -F -