sadpandajoe commented on code in PR #44817:
URL: https://github.com/apache/superset/pull/44817#discussion_r4242653793
##########
.pre-commit-config.yaml:
##########
@@ -46,6 +49,38 @@ repos:
name: mypy (superset-extensions-cli)
args: [--check-untyped-defs]
files: ^superset-extensions-cli/
+ - id: mypy
+ alias: mypy-sole-input-fixtures
+ name: mypy (sole-input fixtures)
+ # Regression guards that only mean something when mypy checks the
+ # fixture as its ONLY input: a type that resolves one way with the
+ # whole tree loaded and another way in a scoped per-PR run (e.g.
+ # UUIDMixin.uuid, see tests/mypy_fixtures/uuid_mixin_nullable.py).
+ # Manual stage, so neither a local `pre-commit run --all-files` nor
+ # the per-PR / nightly runs of the main hook pick it up; CI invokes
+ # it explicitly, one fixture at a time, in
+ # .github/workflows/pre-commit.yml. --no-incremental keeps it from
+ # reusing full-tree types the main hook may already have cached.
+ args: [--check-untyped-defs, --no-incremental]
Review Comment:
This hook still fails on the fixed code: passing one fixture doesn't limit
mypy's diagnostics to that file, and with SQLAlchemy now installed it follows
the fixture's imports into `superset/` and reports their errors (the `mypy
sole-input fixtures` step on this head ends with "Found 1773 errors in 216
files (checked 1 source file)", e.g. `presto_sql_types.py` override errors). So
`pre-commit (current)` goes red for every PR and the guard can't tell a revert
from the fix. Could the hook follow imports silently (e.g.
`--follow-imports=silent`) so only the fixture's `assert_type` lines can fail?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]