Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
teetone committed Dec 28, 2021
1 parent f0d512a commit ac56dc9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: local
hooks:
- id: run-pre-commit
name: run-pre-commit
entry: ./pre-commit.sh
language: script
7 changes: 5 additions & 2 deletions pre-commit.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash

# Run this script before you commit.
# Run this script before you commit: ./pre-commit.sh

# Script fails immediately when any command fails.
# This script fails immediately when any of its commands fail.
set -e

if ! [ -e venv ]; then
python3 -m pip install virtualenv
python3 -m virtualenv -p python3 venv
fi
venv/bin/pip install -r requirements.txt
venv/bin/pip install -r requirements.dev.txt

venv/bin/pip check
Expand All @@ -20,3 +21,5 @@ venv/bin/black .
## Check if there are any mypy or flake8 errors
venv/bin/mypy .
venv/bin/flake8 .

echo "Done."
4 changes: 3 additions & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
black==19.10b0
flake8==3.8.3
mypy==0.782
flake8==3.8.3
pre-commit==2.16.0
typed-ast<1.5.0,>=1.4.0

0 comments on commit ac56dc9

Please sign in to comment.