Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

select/ignore/enable/disable is a mess

Aperta
#260 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
cli, tooling

Direzione di ricerca

Inizia leggendo parse_options e le chiamate a option_manager.extend_default_ignore, poi traccia come le opzioni differiscono tra le modalità plugin e standalone. Confronta il comportamento proposto di enable/disable/select/ignore con ogni caso nell’issue; il lavoro è completato quando le regole ASYNC9xx possono essere abilitate in modo coerente senza dipendere dalla validazione a tre lettere di flake8 e la registrazione delle opzioni standalone è risolta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature

Status quo:

  • ignore or extend-ignore ASYNC error codes in config is not possible, as flake8 gives an error
  • when running flake8-async as a plugin, --ignore and --extend-ignore is possible on the command-line, flake8 does not seem to enforce the three-letter rule there
  • select does not currently have the validation rules enabled that ignore does.
  • --select and --ignore are not supported when running as standalone
  • it's always possible to use --enable and --disable.
  • when running as a plugin, we add individual error codes for ASYNC9xx to the default_ignored codes
  • when running as standalone, we set the default of --disable to ASYNC9.

Implications:

  • if running as plugin, you have to select/--select ASYNC9xx codes to enable them. Trying to enable them will do nothing.
  • But if you want to default-enable ASYNC9xx rules, and disable them individually, you need to use a combination of select/--select and --disable (or --ignore on the CLI).
  • if running as standalone, you have to --enable ASYNC9xx codes. --select gives errors

This is... a mess. And it feels like --[extend-]ignore on the CLI, and select could get hit with the three-letter validation rules at any point which would make it impossible for end-users to enable ASYNC9xx codes unless they downgrade flake8 / we update flake8-async.

suggestions:

  1. Stop calling option_manager.extend_default_ignore
  2. Always default --disable to ASYNC9
  3. in parse_options, read options.select and parse out any selected ASY... codes, adding them to --enable
  4. same thing with options.ignore -> --disable, in case --ignore has been used on the CLI
  5. [maybe] register --select and --ignore as options when running as standalone.
    • this would make it slightly easier to switch from plugin to standalone, but the added complexity might not be worth it. e.g. flake8-async --select=ASYNC --ignore=ASYNC9 --enable=ASYNC91 --disable=ASYNC910 would be possible to write and impossible to understand. Though that's ofc already the case when running as plugin
    • we could give a warning/error if users are using both enable+select or disable+ignore for ASYNC codes though

this would achieve:

  1. You can always use --enable to enable ASYNC9 codes, you're not forced to touch select/ignore
  2. Even if only using select/ignore you get the speed upside of disabling visitors (although this is somewhat diminished after adding ASYNC100 to Visitor91x)
Lingua principale
Python
Stelle
26
Fork
10
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-trio/flake8-async

Tutte le issue di python-trio/flake8-async

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.