Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#1,470 0 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
java
Bereich
cli

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Java
Sterne
6.2k
Forks
940
Ø Merge
5 Min.
Gemergte PRs (30 T.)
8

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus google/google-java-format

Alle Issues in google/google-java-format

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.