You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cb64077
Browse filesBrowse the repository at this point in the historyBrowse files
chore(lint): enforce Python type annotations, unused args, and mypy strictness (#1665)
* chore(lint): enforce Python type annotations, unused args, and mypy strictness
Enable `ANN001`, `ANN201`, `ANN202`, `ARG`, and `SLF001` in `pyproject.toml`
(keeping `per-file-ignores` scoped to test files, storage migrations,
`examples/**` private stub access, framework callback hooks, and uniform CLI
step callbacks) and add explicit parameter and return annotations across prod
scripts while tightening mock lambda parameter names in `examples/`.
Also enable `warn_unreachable = true`, `strict_equality = true`, and
`enable_error_code = ["ignore-without-code"]` in `[tool.mypy]`, fix three
unreachable branches, narrow one Optional assertion in
`github_utils_test.py`, and specify explicit error codes on the eight
`# type: ignore` suppressions in `xmc_entities_validator_test.py`.
Assumptions:
- Production Python functions require explicit parameter and return type
annotations while test modules and generated migrations retain their
existing exemptions.
TAG=agy
CONV=ba8411ef-c093-4f45-950a-b3bc1899268c
* chore(lint): address PR #1665 review feedback on typing and ARG001
Replace overly broad `Any` annotations and file-level `ARG001` suppression
raised during review of PR #1665:
- Type `examples/chart_artifact_job/launch.py` dashboard, chart, artifact, and
ESS wrapper signatures concretely via `if TYPE_CHECKING:` imports
(`xdash._protos.messages_pb2`, `ExperimentStateGRpcApi`) and `artifact_pb2.Artifact`.
- Remove the file-wide `ARG001` ignore on `tools/dev_env/deploy_dev_env.py` in
`pyproject.toml` and prefix unused parameters in the 8 `step_*` callbacks
with `_` so positional callers and tests remain intact without masking
unused parameters in the rest of the file.
- Narrow `tools/pr_review/update_pr_description.py:update_pr_description` return
type from `Any` to `dict[str, Any]`.
- Narrow `tools/release/dispatch_and_watch.py:_extract_page_url` parameter type
from `Any` to `object` while keeping the `isinstance(..., dict)` guard
reachable under `warn_unreachable`, with a unit test for non-dict inputs.
Comment link: #1665 (comment)
Comment link: #1665 (comment)
Comment link: #1665 (comment)
Comment link: #1665 (comment)
TAG=agy
CONV=ba8411ef-c093-4f45-950a-b3bc1899268c
0 commit comments