aboutsummaryrefslogtreecommitdiffstats
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 9472572..3ec64a5 100755
--- a/build.sh
+++ b/build.sh
@@ -16,3 +16,10 @@ contents="$(cat slack/python_compatibility.py slack/util.py slack/shared.py slac
echo "$contents" | grep -v '^from __future__' | grep -E '^(import|from) ' | sort -u
echo "$contents" | grep -Ev '^(import|from) ' | sed 's/^\( \+\)\(import\|from\) .*/\1pass/'
) > build/slack.py
+
+ruff_cmd="$(poetry run sh -c 'command -v ruff' 2>/dev/null || command -v ruff)"
+
+if [ -x "$ruff_cmd" ]; then
+ "$ruff_cmd" check -q --fix-only --target-version py37 build/slack.py
+ "$ruff_cmd" format -q --target-version py37 build/slack.py
+fi