Skip to content

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

Description

@cushon

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 (#425 (comment)). 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions