Update uncrustify usage in README

This commit is contained in:
Laura Hausmann 2023-04-21 21:41:56 +02:00
parent 59c0d094e3
commit f7105a747e
Signed by: zotan
GPG key ID: D044E84C5BE01605
2 changed files with 7 additions and 1 deletions

View file

@ -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.

6
scripts/uncrustify.sh Normal file
View file

@ -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 -