Skip to content

Commit b4cf32f

Browse files
Apply repo-review MyPy suggestions
MY103: MyPy warn unreachable Must have `warn_unreachable` (true/false) to pass this check. There are occasionally false positives (often due to platform or Python version static checks), so it's okay to set it to false if you need to. But try it first - it can catch real bugs too. MY104: MyPy enables ignore-without-code Must have `"ignore-without-code"` in `enable_error_code = [...]`. This will force all skips in your project to include the error code, which makes them more readable, and avoids skipping something unintended. MY105: MyPy enables redundant-expr Must have `"redundant-expr"` in `enable_error_code = [...]`. This helps catch useless lines of code, like checking the same condition twice. MY106: MyPy enables truthy-bool Must have `"truthy-bool"` in `enable_error_code = []`. This catches mistakes in using a value as truthy if it cannot be falsy.
1 parent 2b92ca6 commit b4cf32f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ title_format = "## [{version}](https://github.com/pypa/pipx/tree/{version}) - {p
119119
issue_format = "[#{issue}](https://github.com/pypa/pipx/issues/{issue})"
120120
package = "pipx"
121121

122+
[tool.mypy]
123+
warn_unreachable = true
124+
enable_error_code = [ "ignore-without-code", "redundant-expr", "truthy-bool" ]
125+
122126
[[tool.mypy.overrides]]
123127
module = [
124128
"pycowsay.*",

0 commit comments

Comments
 (0)