first transform, then visit, to not get incorrect line markers
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Inizia dal test fallito test_line_numbers_match_end_result e segui Plugin.from_source, initialize_options e plugin.run. Verifica in quale sequenza vengono eseguiti gli autofixer e i visitor e come vengono mantenuti i marcatori di riga. Il lavoro è completato quando gli autofixer vengono eseguiti prima del nuovo parsing, i visitor vedono il codice sorgente trasformato e l’assertion segnala la riga corretta per trio.sleep(0).
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
low-priority QoL - unless flake8-trio is used in automated environments.
Failing test:
def test_line_numbers_match_end_result():
text = """import trio
with trio.move_on_after(10):
...
trio.sleep(0)
"""
plugin = Plugin.from_source(text)
initialize_options(plugin, args=["--enable=TRIO100,TRIO115", "--autofix=TRIO100"])
errors = tuple(plugin.run())
new_source = plugin.module.code
assert errors[1].line == plugin.module.code.split('\n').index('trio.sleep(0)')+1
the assertion fails with 5 != 4 as the line numbers of objects are never updated once parsed when initiating the plugin.
The best way to fix this would probably, as the header suggest, be to first make a pass where all enabled autofixers are run - with autofixed errors being printed out with old and/or no line markers. Then the file is reparsed, and enabled visitors are run on the file.
- 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
- 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 python-trio/flake8-async
-
Rename ASYNC126 to ASYNC4xx Apertarule improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
python-trio/flake8-async#457 · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
python-trio/flake8-async#475 · 1 commento ·
-
Warn about unused `noqa`s Apertanew rule
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
python-trio/flake8-async#454 · 1 commento ·
-
ASYNC103 for sync functions Apertarule improvement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
python-trio/flake8-async#447 · 5 commenti ·
-
good first issue
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
python-trio/flake8-async#396 · 1 commento ·
Tutte le issue di python-trio/flake8-async
Issue simili
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
open-webui/open-webui#30750 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100