[Feature Request]: get type checking working during argument parsing
I maintainer di solito rispondono entro 1 giorno
@wgreenberg ci sta già lavorando.
Dal 12/2/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What problem does this feature solve or what does it enhance?
in the past few months, we've had three different bugs caused by the absence of type checking on the argparse.Namespace object during argument parsing. i think we should fix this so our tools can catch this kind of thing for us
Proposed Solution
i think the best way to do this is to implement something like what i did at https://gist.github.com/bmw/459b81b21eeb3ab13fb1a974dfc994e5. this is only meant to be a proof of concept so pretty much all design decisions here and especially things like naming and which files to put this in should be revisited, but i've confirmed that an approach like this would allow mypy to catch these kind of bugs
beyond this basic problem and solution, i think there's still a number of design decisions to be made here, especially if we're interested in making this a larger project. there was some discussion about this in a private mattermost channel in the thread starting here which may be helpful to refer back to
to pull some points from that discussion that i personally think are important, we for starters need a way to get all the expected types documented somewhere so mypy can use them for static analysis. we may also want to set up logic so our code errors if we add a new command line argument and forget to specify its type in this new system. an important thing to keep in mind about errors like this though is we should ensure things still work for 3rd party plugins which certbot currently has hundreds of
going beyond the problems during argument parsing, our NamespaceConfig object also has limited type checking and i doubt my gist would help with that as __getattr__ returns Any. perhaps there's more refactoring that could/should be done here around this and/or the CLI_DEFAULTS object
in my mind, this issue is primarily a design issue to figure out the exact path forward here. if whoever takes this wants to then create subissues that can be divvied up amongst the team, i personally think that is very reasonable, but i wanted to create this initial issue here to help keep us working and thinking about this problem. i personally think it's important and likely to help us in the future
Alternatives Considered
No response
- Lingua principale
- Python
- Stelle
- 33.4k
- Fork
- 3.5k
- Merge medio
- 4g 2h
- PR unite (30g)
- 11
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di certbot/certbot
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
[Task]: "If you like Certbot, please consider supporting our work by" should only link to EFFAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
dns-google: add_txt_record appends unquoted value onto quoted existing rrdatasForse già presa @BeigeBox l’ha presa 229 giorni fa. Apertahas pr
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[Task]: Update apache configs to use ML-KEM handshakesForse già presa @bmw l’ha presa 2 giorni fa. Aperta
certbot/certbot#10840 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Task]: Make 384 the default ECDSA curve sizeForse già presa @wgreenberg l’ha presa 2 giorni fa. Aperta
certbot/certbot#10838 · 1 commento · 4 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di certbot/certbot
Issue simili
-
Test: to_hijri() accepts datetime.datetime and uses only the date partForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertagood first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno