Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,470 0 bình luận 5 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
6.2k
Fork
940
Merge trung bình
5 phút
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google/google-java-format

Tất cả issue của google/google-java-format

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.