Skip to content

Commit

Permalink
test-formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
KommuSoft committed Aug 16, 2024
1 parent 1ae9f70 commit 911dfe0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ format () {
git ls-files "$pat" | xargs -- "$@" --
fi
}
format () {
opar="$1"
shift
pat="$1"
shift
for f in `git ls-files --error-unmatch "$pat" 2>/dev/null`; do
"$@" -- "$f" "$opar" "$f"
done
}


format '*.hs' ormolu
format '*.py' python3 -m isort --
format '*.py' python3 -m black -- -S -q
format '*.sql' python3 -m sqlformat -reindent -s -keywords upper -identifiers lower
formatp -O '*.sql' python3 -m sqlformat -reindent -s -keywords upper -identifiers lower
format '*.yaml' yamlfmt -w
format '*.yml' yamlfmt -w

0 comments on commit 911dfe0

Please sign in to comment.