rustfmt gives legal length comments a ragged edge in argument lists
Maintainer thường phản hồi trong vòng 1 ngày
@matthewhughes934 đang làm issue này rồi.
Từ ngày 9/10/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
Start by reproducing the reported output with the nested Rust argument-list example and the shown rustfmt configuration (wrap_comments = true, comment_width = 100). Read rustfmt's comment-wrapping implementation and its tests for comments in argument lists; the issue does not name specific files. Done means formatting preserves the reported legal-length comment without producing the ragged reflow shown.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Here is a Rust file with no line longer than 100 bytes, and one line equal to 100 bytes:
fn main() {
if true {
if true {
if true {
if true {
if true {
if true {
foo(
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
// eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
// enim ad minim veniam, quis nostrud exercitation ullamco laboris
// nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
// reprehenderit in voluptate velit esse cillum dolore eu fugiat
// nulla pariatur.
1,
);
}
}
}
}
}
}
}
The comment shouldn't be changed by rustfmt, but it does change it, giving it a very ragged edge:
> cat config.toml
wrap_comments = true
comment_width = 100
> rustfmt +nightly --version
rustfmt 1.11.0-nightly (1d81eb4ad9 2026-10-07)
> rustfmt +nightly --emit=stdout --config-path config.toml foo.rs
fn main() {
if true {
if true {
if true {
if true {
if true {
if true {
foo(
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
// eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
// enim ad minim veniam, quis nostrud exercitation ullamco laboris
// nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
// in reprehenderit in voluptate
// velit esse cillum dolore eu fugiat
// nulla pariatur.
1,
);
}
}
}
}
}
}
}
- Ngôn ngữ chính
- Rust
- Star
- 7.1k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rust-lang/rustfmt
-
A-config C-bug SO-print-config
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
A-Unicode C-bug P-low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
rust-lang/rustfmt#7210 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A-imports C-bug E-hard I-non-idempotency X-impacts-stable-default-format
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
rust-lang/rustfmt#7173 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A-comments C-bug only-with-option UO-indent_style
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix `first_line_width` to be tab-awareCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởA-tabs A-whitespace C-bug SO-hard_tabs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rust-lang/rustfmt
Issue tương tự
-
bug P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug core-lang
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Windows microphone listing treats words in a device name as DirectShow labelsCó thể đã có người làm @Sujal-chaudhary đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
clipy-recorder/clipy#447 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
nightly-cleanup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
max-sixty/worktrunk#4939 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày