-
Notifications
You must be signed in to change notification settings - Fork 888
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
Try to solve issue 3417. #3535
Merged
Merged
Try to solve issue 3417. #3535
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a653e30
Add tests for #3417.
xiongmao86 3300bb2
Isolate format_doc_comment with normalize_comments and wrap_comments.
xiongmao86 6a6924c
Change config option from format_doc_comments to format_code_in_doc_c…
xiongmao86 97d7216
Revert "Change config option from format_doc_comments to format_code_…
xiongmao86 de425f1
Fix docs in Configurations.md.
xiongmao86 a956a20
Revert "Revert "Change config option from format_doc_comments to form…
xiongmao86 a9932f6
update CHANGELOG.
xiongmao86 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// rustfmt-normalize_comments: true | ||
// rustfmt-format_doc_comments: true | ||
|
||
//! This is a list: | ||
//! * Outer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/source/normalize_doc_attributes_should_not_imply_format_doc_comments.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// rustfmt-normalize_doc_attributes: true | ||
|
||
/// Foo | ||
/// | ||
/// # Example | ||
/// ``` | ||
/// # #![cfg_attr(not(dox), feature(cfg_target_feature, target_feature, stdsimd))] | ||
/// # #![cfg_attr(not(dox), no_std)] | ||
/// fn foo() { } | ||
/// ``` | ||
/// | ||
fn foo() {} | ||
|
||
#[doc = "Bar documents"] | ||
fn bar() {} |
16 changes: 16 additions & 0 deletions
16
tests/source/wrap_comments_should_not_imply_format_doc_comments.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// rustfmt-wrap_comments: true | ||
|
||
/// Foo | ||
/// | ||
/// # Example | ||
/// ``` | ||
/// # #![cfg_attr(not(dox), feature(cfg_target_feature, target_feature, stdsimd))] | ||
/// # #![cfg_attr(not(dox), no_std)] | ||
/// fn foo() { } | ||
/// ``` | ||
/// | ||
fn foo() {} | ||
|
||
/// A long commment for wrapping | ||
/// This is a long long long long long long long long long long long long long long long long long long long long sentence. | ||
fn bar() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// rustfmt-normalize_comments: true | ||
// rustfmt-format_doc_comments: true | ||
|
||
//! This is a list: | ||
//! * Outer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/target/normalize_doc_attributes_should_not_imply_format_doc_comments.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// rustfmt-normalize_doc_attributes: true | ||
|
||
/// Foo | ||
/// | ||
/// # Example | ||
/// ``` | ||
/// # #![cfg_attr(not(dox), feature(cfg_target_feature, target_feature, stdsimd))] | ||
/// # #![cfg_attr(not(dox), no_std)] | ||
/// fn foo() { } | ||
/// ``` | ||
/// | ||
fn foo() {} | ||
|
||
///Bar documents | ||
fn bar() {} |
16 changes: 16 additions & 0 deletions
16
tests/target/wrap_comments_should_not_imply_format_doc_comments.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// rustfmt-wrap_comments: true | ||
|
||
/// Foo | ||
/// | ||
/// # Example | ||
/// ``` | ||
/// # #![cfg_attr(not(dox), feature(cfg_target_feature, target_feature, stdsimd))] | ||
/// # #![cfg_attr(not(dox), no_std)] | ||
/// fn foo() { } | ||
/// ``` | ||
fn foo() {} | ||
|
||
/// A long commment for wrapping | ||
/// This is a long long long long long long long long long long long long long | ||
/// long long long long long long long sentence. | ||
fn bar() {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't know how to write this if block a better way, please give me suggestion.
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.
And I wonder how to select multiply lines in the commit view. please give me suggestion.