(🐞) error code that is enabled in the config file can't be disabled on the CLI (with `--disable-error-code`)
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
I think it would be intuitive for commandline arguments to override config file options, but the way that enable/disable-error-code works isn't.
pyproject.toml
[tool.mypy]
enable_error_code = "operator"
> mypy --disable-error-code operator -c "1 + ''"
test.py:1: error: Unsupported operand types for + ("int" and "str") [operator]
Found 1 error in 1 file (checked 1 source file)
The docs specify how these flags interact with themselves, but don't mention the ones in the config file.
--enable-error-code
This flag allows enabling one or multiple error codes globally. See [Error codes](https://mypy.readthedocs.io/en/stable/error_codes.html#error-codes) for more information.
Note: This flag will override disabled error codes from the [--disable-error-code](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-disable-error-code) flag.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit nachzuverfolgen, wie mypy enable_error_code und disable_error_code aus pyproject.toml mit den Befehlszeilenoptionen kombiniert. Reproduziere das Beispiel mit --disable-error-code operator und füge anschließend Abdeckung für die Kombination aus Konfiguration und CLI hinzu. Erledigt ist die Aufgabe, wenn die CLI-Option den konfigurierten Fehlercode unterdrückt und die Dokumentation diese Vorrangregel erklärt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 50/100