Skip to content

Commit b52a659

Browse files
Merge pull request #1909 from VWS-Python/strictest-ty-config
Use Ty's strictest recommended configuration
2 parents 4195bf4 + b704652 commit b52a659

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎pyproject.toml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ line-length = 79
111111
lint.select = [
112112
"ALL",
113113
]
114+
lint.extend-select = [ "ANN", "PGH003", "PYI" ]
114115
lint.ignore = [
115116
# Ruff warns that this conflicts with the formatter.
116117
"COM812",
@@ -126,6 +127,7 @@ lint.ignore = [
126127
# helping.
127128
"PLR0913",
128129
]
130+
lint.explicit-preview-rules = true
129131
lint.per-file-ignores."doccmd_*.py" = [
130132
# Allow our chosen docstring line-style - pydocstringformatter handles
131133
# formatting but docstrings in docs may not match this style.
@@ -152,6 +154,7 @@ lint.flake8-tidy-imports.banned-api."typing.cast".msg = """\
152154
typing.cast is banned: use explicit type narrowing or a typed variable instead.\
153155
"""
154156
lint.pydocstyle.convention = "google"
157+
lint.preview = true
155158

156159
[tool.pylint]
157160
DEPRECATED_BUILTINS.bad-functions = [
@@ -369,6 +372,23 @@ typeCheckingMode = "strict"
369372
enableTypeIgnoreComments = false
370373
reportUnnecessaryTypeIgnoreComment = true
371374

375+
[tool.ty]
376+
rules.blanket-ignore-comment = "error"
377+
rules.division-by-zero = "warn"
378+
rules.dynamic-function-decorator-return = "error"
379+
rules.missing-type-argument = "error"
380+
rules.possibly-missing-attribute = "warn"
381+
rules.possibly-missing-import = "warn"
382+
rules.possibly-unresolved-reference = "warn"
383+
rules.unsound-assignment = "error"
384+
rules.unsound-return-statement = "error"
385+
rules.unsound-yield = "error"
386+
rules.unsupported-dynamic-base = "warn"
387+
terminal.error-on-warning = true
388+
analysis.respect-type-ignore-comments = false
389+
analysis.strict-equality-semantics = true
390+
analysis.strict-generic-narrowing = true
391+
372392
[tool.pytest]
373393
log_cli = true
374394
xfail_strict = true

0 commit comments

Comments
 (0)