Skip to content

Commit

Permalink
Apply repo-review MyPy suggestions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DimitriPapadopoulos committed Aug 24, 2024
1 parent 2b92ca6 commit b4cf32f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ title_format = "## [{version}](https://github.com/pypa/pipx/tree/{version}) - {p
issue_format = "[#{issue}](https://github.com/pypa/pipx/issues/{issue})"
package = "pipx"

[tool.mypy]
warn_unreachable = true
enable_error_code = [ "ignore-without-code", "redundant-expr", "truthy-bool" ]

[[tool.mypy.overrides]]
module = [
"pycowsay.*",
Expand Down

0 comments on commit b4cf32f

Please sign in to comment.