File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Local lint script matching the CI Validate job + mypy type checks.
3+ # Fixes formatting and import sorting in-place, then re-verifies in
4+ # check mode to catch any conflicts between the two, and runs mypy.
5+ set -euo pipefail
6+
7+ err=0
8+
9+ echo " ==> ruff format (auto-fixing)"
10+ python -m ruff format spacy
11+
12+ echo " ==> ruff isort (auto-fixing)"
13+ python -m ruff check spacy --select I --fix
14+
15+ echo " ==> ruff format (verify)"
16+ if ! python -m ruff format spacy --check; then
17+ echo " FAIL: isort fix broke formatting"
18+ err=1
19+ fi
20+
21+ echo " ==> ruff isort (verify)"
22+ if ! python -m ruff check spacy --select I; then
23+ echo " FAIL: format fix broke import sorting"
24+ err=1
25+ fi
26+
27+ echo " ==> mypy"
28+ if ! python -m mypy spacy; then
29+ err=1
30+ fi
31+
32+ if [ " $err " -ne 0 ]; then
33+ echo " FAIL: see errors above"
34+ exit 1
35+ fi
36+
37+ echo " OK: all checks passed"
You can’t perform that action at this time.
0 commit comments