Skip to content

Commit

Permalink
Merge pull request #1893 from opentensor/feature/roman/local-pre-comm…
Browse files Browse the repository at this point in the history
…it-checker

Add Pre-commit Checker in scripts. Helps reduce CI calls.
  • Loading branch information
gus-opentensor committed May 17, 2024
2 parents efada21 + d81c3b0 commit 97c7587
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 .\`."
python3 -m black --exclude '(env|venv|.eggs|.git)' .

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

# mypy checks python versions compatibility
versions=("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 97c7587

Please sign in to comment.