Skip to content

Commit

Permalink
docs: clarify imports_granularity behavior with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed May 27, 2022
1 parent 73be264 commit 3e38399
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Fixed

- Don't change granularity of imports containing comments with `imports_granularity` if doing so could lose or misplace those comments [#5311](https://github.com/rust-lang/rustfmt/pull/5311)
- Prevent rustfmt from removing trailing comments at the end of files annotated with inner `#![rustfmt::skip]` attributes [#5033](https://github.com/rust-lang/rustfmt/issues/5033)
- Fixed various `error[internal]: left behind trailing whitespace"` issues:
- Remove trailing whitespace when formatting a where clause who's bounds have an empty right hand side [#5012](https://github.com/rust-lang/rustfmt/issues/5012) [#4850](https://github.com/rust-lang/rustfmt/issues/4850)
Expand Down
2 changes: 2 additions & 0 deletions Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,8 @@ How imports should be grouped into `use` statements. Imports will be merged or s
- **Possible values**: `Preserve`, `Crate`, `Module`, `Item`, `One`
- **Stable**: No (tracking issue: [#4991](https://github.com/rust-lang/rustfmt/issues/4991))

Note that rustfmt will not modify the granularity of imports containing comments if doing so could potentially lose or misplace said comments.

#### `Preserve` (default):

Do not change the granularity of any imports and preserve the original structure written by the developer.
Expand Down

0 comments on commit 3e38399

Please sign in to comment.