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

Formatting parameters (tab size, naming convention) are passed to styler but not lintr

Chiusa
#663 1 commento 1 reazione 0 assegnatari Vedi su GitHub

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
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
r
Ambito
tooling

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

  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 REditorSupport/languageserver

Tutte le issue di REditorSupport/languageserver

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.