Formatting parameters (tab size, naming convention) are passed to styler but not lintr
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Leggi le impostazioni di indentation_linter in .lintr e le chiamate a lint in R/diagnostics.R intorno alle righe 100-104, quindi traccia il percorso dei parametri di formattazione fino al language server. Il lavoro è completato quando le diagnosi del linter usano i parametri di formattazione, incluse dimensioni di indentazione non predefinite, senza un ciclo continuo di correzioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
An issue I've been having is that using the LS to format code results in immediate errors from lintr, particularly because the parameters sent in DocumentFormattingParams as part of formatting requests do not get used for the parameters of linters. This causes, e.g. the document to be indented according to the specified indent size, but the indentation linter to immediately tag it as wrong because it thinks the indent size is the default 2. Am I missing something here? Is there some way to manually specify the parameters that get sent to calls to linters?
For context, I am using emacs eglot to edit R code. Investigating the eglot code, the package uses the emacs parameter tab-width as part of the document formatting parameters. As things are, setting that width to anything other than the tidyverse 2-space standard causes the aforementioned "correction thrashing".
Edit:
I've found the relevant part of the codebase. It appears that the indent parameter of the indentation_linter is hard-coded to 2 (among other parameters that are left to defaults or hard-coded), when it should change according to the parameters sent to the server, as the DocumentFormattingParams do. The lintr documentation specifies that the linter parameters can be specified on-the-fly with options() or with every call to lint() (which would be consistent with the formatting behavior).
If my prelimary investigation is correct, changing the calls to lint() here to inject the format options with every call would 'fix' the issue (though it might increase memory usage, so using options() might be better). I am not a professional programmer or familiar with this codebase, so I am hesitant to write the patch myself.
- Lingua principale
- R
- Stelle
- 675
- Fork
- 118
- Merge medio
- 1g 11h
- PR unite (30g)
- 11
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 REditorSupport/languageserver
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
REditorSupport/languageserver#776 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
REditorSupport/languageserver#735 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
REditorSupport/languageserver#731 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
REditorSupport/languageserver#730 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
REditorSupport/languageserver#771 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di REditorSupport/languageserver
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
datacarpentry/semester-biology#1266 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
REditorSupport/vscode-R#1785 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
ImperialCollegeLondon/ve_data_science#666 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 13 giorni