Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Cerrado
#663 1 comentario 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
r
Área
tooling

Línea de trabajo

Lee la configuración de indentation_linter en .lintr y las llamadas a lint en R/diagnostics.R alrededor de las líneas 100-104; después, sigue el recorrido de los parámetros de formato hasta el servidor de lenguaje. La tarea estará terminada cuando los diagnósticos del linter usen los parámetros de formato, incluido un tamaño de indentación no predeterminado, sin ciclos repetidos de corrección.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
R
Estrellas
679
Forks
119
Merge medio
1 d 18 h
PR fusionados (30 d)
30

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

  • Sin Dockerfile ni archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de REditorSupport/languageserver

Todos los issues de REditorSupport/languageserver

Issues similares

Más issues de R

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.