-
Notifications
You must be signed in to change notification settings - Fork 925
add config inline_attribute_width #3409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! You need to add a section in the documentation about this new option:
---- test::configuration_snippet_tests stdout ----
thread 'test::configuration_snippet_tests' panicked at 'inline_attribute_width does not have a configuration guide', src/test/mod.rs:908:17
5ebe9d9
to
585e9db
Compare
585e9db
to
bb16523
Compare
Thank you for the review. I fixed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the test failure, maybe replace rust
with ignore
in https://github.com/rust-lang/rustfmt/pull/3409/files#diff-9de0a570da3404ffd4b364ef6a9f8195R2424
I think that we do not need the version gate in this case. The purpose of the version gate is to ensure that users using the default format style won't be affected by formatting changes between rustfmt version updates. |
Could you apply this to the attribute on |
0e862d8
to
c3a168c
Compare
Thank a lot! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a test failing when run with the beta channel
Mismatch at tests/source/issue-3343.rs:1:
// rustfmt-config: inline_attribute_width.toml
-#[cfg(feature = "alloc")] use core::slice;
+#[cfg(feature = "alloc")]
+use core::slice;
-#[cfg(feature = "alloc")] use total_len_is::_50__;
+#[cfg(feature = "alloc")]
+use total_len_is::_50__;
#[cfg(feature = "alloc")]
use total_len_is::_51___;
Mismatch at tests/source/issue-3343.rs:9:
-#[cfg(feature = "alloc")] extern crate len_is_50_;
+#[cfg(feature = "alloc")]
+extern crate len_is_50_;
#[cfg(feature = "alloc")]
extern crate len_is_51__;
can you add a test to see what happens with @topecongiro comment ? #3409 (comment) |
c3a168c
to
e78e95f
Compare
Thank you for kindness review many times! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rchaser53 Thank you for your continuous work on this. Other than typos in the documents, this looks good to me.
If the line width is width within config width, attribute is inline. I don't want to change default rustfmt behavior, so config default value is 0. - fix description - fix test comment - remove unnecessary clone - remove unnecessary test file - fix test for β version - attributes => attribute
e78e95f
to
5528323
Compare
Oops. Thank you. I fixed it. |
5528323
to
be7b3ba
Compare
- attributes => attribute
related: #3343
If the line width is width within config width, attribute is inline.
I don't want to change default rustfmt behavior, so config default value is 0.