File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -144,11 +144,16 @@ while read LOCAL_REF LOCAL_SHA REMOTE_REF REMOTE_SHA; do
144144 if command -v mypy & > /dev/null; then
145145 info " Running MyPy type checking..."
146146
147- if mypy . 2> /dev/null; then
148- success " MyPy type checking passed"
147+ # Run mypy on src/ directory only (tests/examples excluded in pyproject.toml)
148+ if [ -d " src" ]; then
149+ if mypy src/ 2> /dev/null; then
150+ success " MyPy type checking passed"
151+ else
152+ error " MyPy type checking failed. Please fix all type errors before pushing."
153+ exit 1
154+ fi
149155 else
150- error " MyPy type checking failed. Please fix all type errors before pushing."
151- exit 1
156+ info " No src/ directory found, skipping type checking"
152157 fi
153158 echo " "
154159 else
Original file line number Diff line number Diff line change @@ -181,6 +181,16 @@ module = [
181181]
182182ignore_missing_imports = true
183183
184+ [[tool .mypy .overrides ]]
185+ module = [
186+ " flask" ,
187+ " flask.*" ,
188+ " starlette.*" ,
189+ " fastapi" ,
190+ " fastapi.*" ,
191+ ]
192+ ignore_missing_imports = true
193+
184194[tool .ruff ]
185195target-version = " py312"
186196line-length = 100
You can’t perform that action at this time.
0 commit comments