mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-08-07 14:03:56 -06:00
Add a code formatter
This commit is contained in:
parent
fda1ef2dd3
commit
9a0b0d8469
3 changed files with 341 additions and 0 deletions
30
buildroot/bin/format_code
Executable file
30
buildroot/bin/format_code
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# format_code [dir/file...]
|
||||
#
|
||||
|
||||
HERE=`dirname $0`
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
|
||||
val="$1"
|
||||
|
||||
if [ -d "$val" ]; then
|
||||
|
||||
find $val -name *.cpp -exec "$HERE/uncrust" '{}' \;
|
||||
|
||||
elif [ -d "./Marlin/src/$val" ]; then
|
||||
|
||||
find "./Marlin/src/$val" -name *.cpp -exec "$HERE/uncrust" '{}' \;
|
||||
|
||||
elif [ -f "./Marlin/src/$val" ]; then
|
||||
|
||||
uncrust "./Marlin/src/$val"
|
||||
|
||||
elif [ -f "$val" ]; then
|
||||
|
||||
uncrust "$val"
|
||||
|
||||
fi
|
||||
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue