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

Support using tabs for indentation (--use-tabs flag)

Abierto
#1,470 0 comentarios 5 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java
Área
cli

Línea de trabajo

Review the API support added in #1320 and the existing --max-line-length CLI option as starting points. Determine how a --use-tabs flag should connect to the formatter’s tab configuration, then verify that CLI formatting uses tab-based indentation while preserving the project’s opinionated formatting behavior.

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

Descripción

Support for configuring tabs was added to the API in #1320, but there is not currently a CLI flag for it.

In general google-java-format remains committed to being an opinionated, low-configuration formatter (https://github.com/google/google-java-format/issues/425#issuecomment-5928605364). Line lengths and tabs are in a different category than configuration for core formatting layout decisions. Other opinionated formatters also support configuring line lengths and tabs.

The bug for line lengths (#425) reviewed more votes, there have been fewer requests for tabs. There's some evidence tabs are not as widely used as spaces in the Java ecosystem.

Another potential different from --max-line-length is that it's possible to convert spaces to tabs by post-processing the formatter output, i.e.

google-java-format - | unexpand -t 2

Adding a --use-tabs flag is currently unplanned, this bug tracks demand for it. If you would like to use google-java-format but its lack of support for tab-based indents is prevent you from doing that, please 'thumbs up' the bug or leave a comment.

Lenguaje dominante
Java
Estrellas
6.2k
Forks
940
Merge medio
5 min
PR fusionados (30 d)
7

Preparar el entorno

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 google/google-java-format

Todos los issues de google/google-java-format

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.