Skip to content

Commit 7ab2b6f

Browse files
authored
fix(py): missing config (#452)
1 parent ec6e510 commit 7ab2b6f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

docs/contributing/coding_guidelines.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ Both type checkers are configured in `python/pyproject.toml`.
5757
and infer return types
5858
* `python_version = "3.10"`: Matches ruff.target-version
5959

60-
**ty** (`[tool.ty.src]`):
60+
**ty** (`[[tool.ty.overrides]]`):
6161

62-
* `exclude`: Excludes the `samples` directory (external dependencies not in workspace)
62+
* Uses overrides to ignore `unresolved-import` errors in `samples/` directory
63+
(external dependencies not installed in the workspace)
64+
* ty still type-checks all code in samples, just tolerates missing third-party imports
6365

6466
### Error Suppression Policy
6567

python/pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ untyped_def_behavior = "check-and-infer-return-type"
190190
# example-error-code = false
191191

192192
# ty (Astral/Ruff) type checker configuration.
193-
[tool.ty.src]
194-
# Exclude samples directory as they have external dependencies not in the workspace.
195-
exclude = ["samples"]
193+
# Use overrides to ignore unresolved-import errors in samples directory,
194+
# which has external dependencies not installed in the workspace.
195+
# This lets ty check all code while tolerating missing third-party stubs.
196+
[[tool.ty.overrides]]
197+
include = ["samples/**"]
198+
199+
[tool.ty.overrides.rules]
200+
unresolved-import = "ignore"

0 commit comments

Comments
 (0)