python / python/mypy

Add --plugins command-line option

Offen
#11,667 7 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature topic-configuration topic-plugins
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Feature

It seems that currently the only way to make mypy load a plugin is to add it to the configuration file as plugins = .... I would love if it would be possible to invoke mypy in the command line with or without a given plugin enabled. For example:

mypy --plugins=mypy_django_plugin.main,other_plugin:custom_entry_point ...

Pitch

The main benefit of this feature is that it would allow us to dynamically load plugins when invoking mypy using mypy.api.run or when invoking mypy using the command line. Currently it is difficult to programmatically "inject" a plugin into a mypy run, this change would make this much easier.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, mypy's Befehlszeilenverarbeitung, die Konfigurationsdatei-Einstellung plugins und den im Issue erwähnten Einstiegspunkt mypy.api.run nachzuverfolgen. Ermittle, wie ein --plugins-Wert die aufgelisteten Plugin-Einstiegspunkte sowohl bei Befehlszeilen- als auch bei API-Aufrufen aktivieren könnte, und überprüfe anschließend, dass Aufrufe mit und ohne Plugins wie angefordert funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.