Skip to content

Commit 2b972c9

Browse files
authored
ty as yet another type checker (#5058)
Still heavily reduced ruleset, but over time, things should improve.
1 parent d62f4f1 commit 2b972c9

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ repos:
121121
- "types-docutils"
122122
- "types-lxml"
123123

124+
- repo: https://github.com/astral-sh/ty-pre-commit
125+
rev: v0.0.59
126+
hooks:
127+
- id: ty
128+
124129
- repo: https://github.com/python-jsonschema/check-jsonschema
125130
rev: "0.37.3"
126131
hooks:

pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,39 @@ reportPrivateUsage = false
298298
reportUnknownMemberType = false
299299
reportUnnecessaryCast = false # Unnecessary "cast" call; type is already...
300300

301+
[tool.ty]
302+
environment.root = ["./tmt"]
303+
304+
[tool.ty.rules]
305+
# TODO: ty is very much in its Beta stage, not ready for production.
306+
# Disabling all rules that fail, for the sake of experiment, and will
307+
# enable them one by one when the tool becomes ready.
308+
unresolved-attribute = "ignore"
309+
unknown-argument = "ignore"
310+
unresolved-reference = "ignore"
311+
invalid-argument-type = "ignore"
312+
invalid-return-type = "ignore"
313+
no-matching-overload = "ignore"
314+
invalid-type-form = "ignore"
315+
not-subscriptable = "ignore"
316+
unsupported-operator = "ignore"
317+
possibly-missing-attribute = "ignore"
318+
invalid-assignment = "ignore"
319+
unresolved-import = "ignore"
320+
invalid-method-override = "ignore"
321+
unsupported-base = "ignore"
322+
invalid-key = "ignore"
323+
redundant-cast = "ignore"
324+
deprecated = "ignore"
325+
missing-argument = "ignore"
326+
too-many-positional-arguments = "ignore"
327+
invalid-yield = "ignore"
328+
possibly-missing-submodule = "ignore"
329+
invalid-generic-class = "ignore"
330+
call-top-callable = "ignore"
331+
inconsistent-mro = "ignore"
332+
invalid-legacy-type-variable = "ignore"
333+
301334
[tool.ruff]
302335
line-length = 99
303336
src = ["tmt", "tests"]

0 commit comments

Comments
 (0)