File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 rev : 26.1.0
44 hooks :
55 - id : black
6-
6+
7+ - repo : https://github.com/pre-commit/pre-commit-hooks
8+ rev : v6.0.0
9+ hooks :
10+ - id : end-of-file-fixer
11+ - id : trailing-whitespace
12+ - id : check-toml
13+ - id : check-yaml
14+ - id : fix-byte-order-marker
15+
16+ - repo : local
17+ hooks :
18+ - id : autoflake.bash
19+ name : autoflake
20+ entry : .pre-commit/autoflake_runner.bash
21+ language : script
22+ description : Run autoflake against source
23+
24+ - repo : local
25+ hooks :
26+ - id : pytest_runner
27+ name : pytest
28+ language : script
29+ description : Run pytest against source
30+ entry : .pre-commit/pytest_runner.bash
Original file line number Diff line number Diff line change 1+ #! /usr/bin/bash
2+
3+ set -euo pipefail
4+
5+ files=$( git diff --cached --name-only -z --diff-filter=ACM -- ' *.py' )
6+
7+ if [ -z " $files " ]; then
8+ exit 0
9+ fi
10+
11+ autoflake --check --remove-all-unused-imports --ignore-init-modules-imports --verbose
Original file line number Diff line number Diff line change 1+ #! /usr/bin/bash
2+
3+ set -euo pipefail
4+
5+ REPO_ROOT=$( git rev-parse --show-toplevel)
6+ cd " $REPO_ROOT "
7+
8+ if [ ! command -v pytest > /dev/null ]; then
9+ echo " pytest could not be resolved"
10+ exit 1
11+ fi
12+
13+ if [ ! -d " tests" ]; then
14+ echo " No 'tests' directory found at TLD for pytest to run against"
15+ exit 1
16+ fi
17+
18+ files=$( git diff --cached --name-only -z --diff-filter=ACM -- ' *.py' )
19+
20+ if [ -z " $files " ]; then
21+ exit 0
22+ fi
23+
24+ pytest -vv --tb=short
You can’t perform that action at this time.
0 commit comments