Skip to content

Commit

Permalink
Add Pre-commit Checker in scripts. Helps reduce CI calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-opentensor committed May 16, 2024
1 parent 636ea67 commit af327db
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/check_pre_submit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# black checks formating
echo ">>> Run the pre-submit format check with \`black .\`"
black .

echo ">>> Run the pre-submit format check with \`mypy\`"

# mypy checks python versions compatibility
versions=("3.8" "3.9" "3.10" "3.11")
for version in "${versions[@]}"; do
echo "Running mypy for Python $version..."
mypy --ignore-missing-imports bittensor/ --python-version="$version"
done

# flake8 checks errors count in bittensor folder
error_count=$(flake8 bittensor/ --count)
echo ">>> Flake8 found ${error_count} errors"

0 comments on commit af327db

Please sign in to comment.