forked from rust-lang/rustfmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue rust-lang#4746 - formatting of import long lines
- Loading branch information
1 parent
ee2bed9
commit cc7e8a0
Showing
7 changed files
with
372 additions
and
3 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// rustfmt-imports_granularity: Crate | ||
|
||
// Long imports with reordering - from original issue | ||
use foo::bar; | ||
use foo::{foo, baz}; | ||
use abaadfsasdfdsfdfas::aasdffjsioejr::abc::sdsdf::sdfsdfsdf::sdfsdfdsf::{ | ||
asdfasdefasdasdfsdfdfasdf::asdfasdasedfafasdfasdf, | ||
}; | ||
|
||
use foo::bar; | ||
use foo::{foo, baz}; | ||
use abaadfsasdfdsfdfas::aasdffjsioejr::abc::sdsdf::sdfsdfsdf::sdfsdfds::{ | ||
asdfasdefasdasdfsdfdfasdf::asdfasdasedfafasdfasdf, | ||
}; | ||
|
||
// Long imports with different sizes - based on original issue | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::asdf; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::a; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z12345678::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567890123456::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z12345678901234567::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::asdf; | ||
use a; | ||
|
||
// Very long (two lines) imports | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::{foo, baz}; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::foo; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::baz; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::{ | ||
foo::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567, | ||
baz::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567}; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::{ | ||
foo::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567, | ||
baz::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567}; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::{ | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::foo, | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::baz}; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::foo::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::baz::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::foo; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::baz; | ||
use a; |
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,70 @@ | ||
// rustfmt-imports_granularity: Preserve | ||
|
||
// Long imports with reordering - from original issue | ||
use foo::bar; | ||
use foo::{foo, baz}; | ||
use abaadfsasdfdsfdfas::aasdffjsioejr::abc::sdsdf::sdfsdfsdf::sdfsdfdsf::{ | ||
asdfasdefasdasdfsdfdfasdf::asdfasdasedfafasdfasdf, | ||
}; | ||
|
||
use foo::bar; | ||
use foo::{foo, baz}; | ||
use abaadfsasdfdsfdfas::aasdffjsioejr::abc::sdsdf::sdfsdfsdf::sdfsdfds::{ | ||
asdfasdefasdasdfsdfdfasdf::asdfasdasedfafasdfasdf, | ||
}; | ||
|
||
// Long imports with different sizes - based on original issue | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::asdf; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::a; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z12345678::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567890123456::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z12345678901234567::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::asdf; | ||
use a; | ||
|
||
// Very long (two lines) imports | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::{foo, baz}; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::foo; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::baz; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::{ | ||
foo::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567, | ||
baz::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567}; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::{ | ||
foo::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567, | ||
baz::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567}; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::{ | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::foo, | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::baz}; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::foo::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::baz::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567; | ||
use a; | ||
|
||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::foo; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::baz; | ||
use a; |
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,2 @@ | ||
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerBinding:: | ||
BluetoothRemoteGATTServerMethods; |
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,101 @@ | ||
// rustfmt-imports_granularity: Crate | ||
|
||
// Long imports with reordering - from original issue | ||
use abaadfsasdfdsfdfas::aasdffjsioejr::abc::sdsdf::sdfsdfsdf::sdfsdfdsf:: | ||
asdfasdefasdasdfsdfdfasdf::asdfasdasedfafasdfasdf; | ||
use foo::{bar, baz, foo}; | ||
|
||
use abaadfsasdfdsfdfas::aasdffjsioejr::abc::sdsdf::sdfsdfsdf::sdfsdfds::asdfasdefasdasdfsdfdfasdf:: | ||
asdfasdasedfafasdfasdf; | ||
use foo::{bar, baz, foo}; | ||
|
||
// Long imports with different sizes - based on original issue | ||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::asdf; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::a; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z12345678::z1234567; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567890123456:: | ||
z1234567; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z12345678901234567::z1234567; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::asdf; | ||
|
||
// Very long (two lines) imports | ||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::{baz, foo}; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::{baz, foo}; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::{ | ||
baz::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567, | ||
foo::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567, | ||
}; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::{ | ||
baz::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567, | ||
foo::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567, | ||
}; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::{baz, foo}; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::{ | ||
baz::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567, | ||
foo::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567, | ||
}; | ||
|
||
use a; | ||
use z123::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567::z1234567:: | ||
z1234567::z1234567::{baz, foo}; |
Oops, something went wrong.