Skip to content

Commit 9bcdf64

Browse files
committed
fix: add missing autoformat.sh script
1 parent 5223b9a commit 9bcdf64

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

autoformat.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
#
3+
# This script runs the auto-formatters (isort and pyink)
4+
# to fix code style and import order.
5+
6+
set -e
7+
8+
if ! command -v isort &> /dev/null
9+
then
10+
echo "isort not found, refer to CONTRIBUTING.md to set up dev environment first."
11+
exit
12+
fi
13+
14+
if ! command -v pyink &> /dev/null
15+
then
16+
echo "pyink not found, refer to CONTRIBUTING.md to set up dev environment first."
17+
exit
18+
fi
19+
20+
21+
echo "Running isort to sort imports..."
22+
isort .
23+
24+
echo "Running pyink to reformat code..."
25+
pyink .
26+
27+
echo "Formatting complete."

0 commit comments

Comments
 (0)