Skip to content

Commit 2f49c01

Browse files
committed
Use Ty's strictest recommended configuration
1 parent 4195bf4 commit 2f49c01

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

‎pyproject.toml‎

Lines changed: 21 additions & 3 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.
@@ -148,10 +150,9 @@ lint.unfixable = [
148150
"ERA001",
149151
]
150152
lint.external = [ "NOD" ]
151-
lint.flake8-tidy-imports.banned-api."typing.cast".msg = """\
152-
typing.cast is banned: use explicit type narrowing or a typed variable instead.\
153-
"""
153+
lint.flake8-tidy-imports.banned-api."typing.cast".msg = "typing.cast is banned: use explicit type narrowing or a typed variable instead."
154154
lint.pydocstyle.convention = "google"
155+
lint.preview = true
155156

156157
[tool.pylint]
157158
DEPRECATED_BUILTINS.bad-functions = [
@@ -369,6 +370,23 @@ typeCheckingMode = "strict"
369370
enableTypeIgnoreComments = false
370371
reportUnnecessaryTypeIgnoreComment = true
371372

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

0 commit comments

Comments
 (0)