We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea027f2 commit 9617bc9Copy full SHA for 9617bc9
tools/githook/pre-commit
@@ -14,19 +14,14 @@ if [ "$FILES" != "" ]; then
14
# each file.
15
E=0
16
for F in ${FILES}; do
17
- P=$(git show ":$F" | python3 -c "import sys; compile(sys.stdin.read(), '/dev/null', 'exec')")
18
- if [ "$?" != "0" ]; then
19
- echo "Errors in $F"
20
- echo $P
+
+ if ! git show ":$F" | ruff check - --quiet --stdin-filename "$F"; then
21
E=1
22
- continue
23
fi
24
25
- R=$(git show ":$F" | pycodestyle -)
26
27
28
- echo "$R"
+ if ! git show ":$F" | ruff format - --quiet --check; then
29
+ echo "Formatting errors in $F, run 'make format'"
30
31
done
32
if [ "$E" != "0" ]; then
0 commit comments