File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 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 ' ---------------------------------------'
22+ echo ' | Organizing imports for src/...'
23+ echo ' ---------------------------------------'
24+
25+ isort src/
26+ echo ' All done! ✨ 🍰 ✨'
27+
28+ echo ' ---------------------------------------'
29+ echo ' | Organizing imports for tests/...'
30+ echo ' ---------------------------------------'
31+
32+ isort tests/
33+ echo ' All done! ✨ 🍰 ✨'
34+
35+
36+
37+ echo ' ---------------------------------------'
38+ echo ' | Auto-formatting src/...'
39+ echo ' ---------------------------------------'
40+
41+ find -L src/ -not -path " */.*" -type f -name " *.py" -exec pyink --config pyproject.toml {} +
42+
43+ echo ' ---------------------------------------'
44+ echo ' | Auto-formatting tests/...'
45+ echo ' ---------------------------------------'
46+
47+ find -L tests/ -not -path " */.*" -type f -name " *.py" -exec pyink --config pyproject.toml {} +
48+
49+
50+ echo " Formatting complete."
You can’t perform that action at this time.
0 commit comments