Skip to content

Commit d1873fc

Browse files
committed
Check Python formatting in pre-commit hook
1 parent f085be1 commit d1873fc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bin/git_hooks/check_format.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ check-file () {
1414
fmt="clang-format --assume-filename=$file"
1515
elif [[ "$file" =~ .*\.(css|html|js|json|mjs|ts|tsx)$ ]]; then # keep in sync with .prettierignore
1616
fmt="npx prettier --stdin-filepath $file"
17+
elif [[ "$file" == *.py ]]; then # keep in sync with fmt-py in Makefile
18+
fmt="black - --quiet --line-length 80 --stdin-filename $file"
1719
else
1820
exit 0;
1921
fi

0 commit comments

Comments
 (0)