Lint script

Disable auto committing and make it optional via a cli flag
This commit is contained in:
2026-02-14 14:32:13 +01:00
parent 42aa31b4e9
commit cb30ccc7f2
+16 -5
View File
@@ -1,9 +1,20 @@
#!/bin/bash #!/bin/bash
# save unsaved work for arg in "$@"; do
git stash --include-untracked if [[ "$arg" == "-g" ]]; then
commit=true
# Put your command here
fi
done
if [ "$commit" == true ]; then
# save unsaved work
git stash --include-untracked
fi
find . -type f -regex '.*/.*\.\(c\|cpp\|h\|hpp\)$' -not -path "./external/*" -not -path "./build/*" -exec clang-format -i {} \; find . -type f -regex '.*/.*\.\(c\|cpp\|h\|hpp\)$' -not -path "./external/*" -not -path "./build/*" -exec clang-format -i {} \;
git add -A && git commit -m "Lint" if [ "$commit" == true ]; then
git add -A && git commit -m "Lint"
git stash pop git stash pop
fi