-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fmt): add sort_imports config (#5442)
* sort imports wip * feat: complete sort imports * chore: rm useless check --------- Co-authored-by: Matthias Seitz <[email protected]>
- Loading branch information
1 parent
120ae66
commit cdbaf9d
Showing
5 changed files
with
184 additions
and
8 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
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,34 @@ | ||
// config: sort_imports = true | ||
import "SomeFile0.sol" as SomeOtherFile; | ||
import "SomeFile1.sol" as SomeOtherFile; | ||
import "SomeFile2.sol"; | ||
import "SomeFile3.sol"; | ||
|
||
import "AnotherFile1.sol" as SomeSymbol; | ||
import "AnotherFile2.sol" as SomeSymbol; | ||
|
||
import { | ||
symbol1 as alias3, | ||
symbol2 as alias2, | ||
symbol3 as alias1, | ||
symbol4 | ||
} from "File0.sol"; | ||
import {symbol1 as alias, symbol2} from "File2.sol"; | ||
import {symbol1 as alias, symbol2} from "File3.sol"; | ||
import { | ||
symbol1 as alias1, | ||
symbol2 as alias2, | ||
symbol3 as alias3, | ||
symbol4 | ||
} from "File6.sol"; | ||
|
||
uint256 constant someConstant = 10; | ||
|
||
import {Something2, Something3} from "someFile.sol"; | ||
|
||
// This is a comment | ||
import {Something2, Something3} from "someFile.sol"; | ||
|
||
import {symbol1 as alias, symbol2} from "File3.sol"; | ||
// comment inside group is treated as a separator for now | ||
import {symbol1 as alias, symbol2} from "File2.sol"; |
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,23 @@ | ||
import "SomeFile3.sol"; | ||
import "SomeFile2.sol"; | ||
import "SomeFile1.sol" as SomeOtherFile; | ||
import "SomeFile0.sol" as SomeOtherFile; | ||
|
||
import "AnotherFile2.sol" as SomeSymbol; | ||
import "AnotherFile1.sol" as SomeSymbol; | ||
|
||
import {symbol2, symbol1 as alias} from "File3.sol"; | ||
import {symbol2, symbol1 as alias} from "File2.sol"; | ||
import {symbol2 as alias2, symbol1 as alias1, symbol3 as alias3, symbol4} from "File6.sol"; | ||
import {symbol3 as alias1, symbol2 as alias2, symbol1 as alias3, symbol4} from "File0.sol"; | ||
|
||
uint256 constant someConstant = 10; | ||
|
||
import {Something3, Something2} from "someFile.sol"; | ||
|
||
// This is a comment | ||
import {Something3, Something2} from "someFile.sol"; | ||
|
||
import {symbol2, symbol1 as alias} from "File3.sol"; | ||
// comment inside group is treated as a separator for now | ||
import {symbol2, symbol1 as alias} from "File2.sol"; |
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