python / python/mypy

Exit status when config error

Open
#15,850 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug topic-configuration topic-error-reporting
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

When a config error is detected, mypy outputs a warning, but will still exit successfully, thus not being noticed in a CI run.

Example output:

.mypy.ini: [mypy]: enable_error_code: Invalid error code(s): unused-awaitable  # TODO(PY312): explicit-override
Success: no issues found in 9 source files

Expected:
A non-0 exit status if the configuration file is not correct.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using a configuration file containing the invalid error code shown in the example, then run mypy as it would run in CI. Trace how configuration warnings affect the command's exit status; done means an invalid configuration produces a non-zero status while valid configurations retain their current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.