You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-25
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ GCI splits all import blocks into different sections, now support three section
16
16
- custom: Custom section, use full and the longest match(match full string first, if multiple matches, use the longest one)
17
17
- default: All rest import blocks
18
18
19
-
The priority is standard>custom>default, all sections sort alphabetically inside.
19
+
The priority is standard > default > custom, all sections sort alphabetically inside.
20
20
21
21
All import blocks use one TAB(`\t`) as Indent.
22
22
@@ -49,13 +49,12 @@ Aliases:
49
49
50
50
Flags:
51
51
-d, --debug Enables debug output from the formatter
52
-
-h, --help helpfor print
53
-
-s, --section strings Sections define how inputs will be processed. Section names are case-insensitive and may contain parameters in (). A section can contain a Prefix and a Suffix section which is delimited by ":". These sections can be used for formatting and will only be rendered if the main section contains an entry. The Section order is the same as below, default value is [Standard,Default].
54
-
Std | Standard - Captures all standard packages if they do not match another section
55
-
Prefix(github.com/daixiang0) | pkgPrefix(github.com/daixiang0) - Groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
56
-
Def | Default - Contains all imports that could not be matched to another section type
57
-
[DEPRECATED] Comment(your text here) | CommentLine(your text here) - Prints the specified indented comment
58
-
[DEPRECATED] NL | NewLine - Prints an empty line
52
+
-h, --help helpfor write
53
+
-s, --section strings Sections define how inputs will be processed. Section names are case-insensitive and may contain parameters in (). The section order is standard > default > custom. The default value is [standard,default].
54
+
standard - standard section that Golang provides officially, like "fmt"
55
+
Prefix(github.com/daixiang0) - custom section, groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
56
+
default - default section, contains all rest imports (default [standard,default])
57
+
--skip-generated Skip generated files
59
58
```
60
59
61
60
```shell
@@ -71,12 +70,11 @@ Aliases:
71
70
Flags:
72
71
-d, --debug Enables debug output from the formatter
73
72
-h, --help helpfor write
74
-
-s, --section strings Sections define how inputs will be processed. Section names are case-insensitive and may contain parameters in (). A section can contain a Prefix and a Suffix section which is delimited by ":". These sections can be used for formatting and will only be rendered if the main section contains an entry. The Section order is the same as below, default value is [Standard,Default].
75
-
Std | Standard - Captures all standard packages if they do not match another section
76
-
Prefix(github.com/daixiang0) | pkgPrefix(github.com/daixiang0) - Groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
77
-
Def | Default - Contains all imports that could not be matched to another section type
78
-
[DEPRECATED] Comment(your text here) | CommentLine(your text here) - Prints the specified indented comment
79
-
[DEPRECATED] NL | NewLine - Prints an empty line
73
+
-s, --section strings Sections define how inputs will be processed. Section names are case-insensitive and may contain parameters in (). The section order is standard > default > custom. The default value is [standard,default].
74
+
standard - standard section thatolang provides officially, like "fmt"
75
+
Prefix(github.com/daixiang0) - custom section, groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
76
+
default - default section, contains all rest imports (default [standard,default])
77
+
--skip-generated Skip generated files
80
78
```
81
79
82
80
```shell
@@ -88,13 +86,13 @@ Usage:
88
86
89
87
Flags:
90
88
-d, --debug Enables debug output from the formatter
91
-
-h, --help helpfordiff
92
-
-s, --section strings Sections define how inputs will be processed. Section names are case-insensitive and may contain parameters in (). A section can contain a Prefix and a Suffix section which is delimited by ":". These sections can be used for formatting and will only be rendered if the main section contains an entry. The Section order is the same as below, default value is [Standard,Default].
93
-
Std | Standard - Captures all standard packages if they do not match another section
94
-
Prefix(github.com/daixiang0) | pkgPrefix(github.com/daixiang0) - Groups all imports with the specified Prefix. Imports will be matched to the full and longest Prefix. All groups are in alphabetical order.
95
-
Def | Default - Contains all imports that could not be matched to another section type
96
-
[DEPRECATED] Comment(your text here) | CommentLine(your text here) - Prints the specified indented comment
97
-
[DEPRECATED] NL | NewLine - Prints an empty line
89
+
-h, --help helpforwrite
90
+
-s, --section strings Sections define how inputs will be processed. Section names are case-insensitive and may contain parameters in (). The section order is standard > default > custom. The default value is [standard,default].
91
+
standard - standard section thatolang provides officially, like "fmt"
92
+
Prefix(github.com/daixiang0) - custom section, groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
93
+
default - default section, contains all rest imports (default [standard,default])
Copy file name to clipboardExpand all lines: cmd/gci/gcicommand.go
+5-7
Original file line number
Diff line number
Diff line change
@@ -46,16 +46,14 @@ func (e *Executor) newGciCommand(use, short, long string, aliases []string, stdI
46
46
47
47
debug=cmd.Flags().BoolP("debug", "d", false, "Enables debug output from the formatter")
48
48
49
-
sectionHelp:=`Sections define how inputs will be processed. Section names are case-insensitive and may contain parameters in (). A section can contain a Prefix and a Suffix section which is delimited by ":". These sections can be used for formatting and will only be rendered if the main section contains an entry. The Section order is the same as below, default value is [Standard,Default].
50
-
Std | Standard - Captures all standard packages if they do not match another section
51
-
Prefix(github.com/daixiang0) | pkgPrefix(github.com/daixiang0) - Groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
52
-
Def | Default - Contains all imports that could not be matched to another section type
53
-
[DEPRECATED] Comment(your text here) | CommentLine(your text here) - Prints the specified indented comment
54
-
[DEPRECATED] NL | NewLine - Prints an empty line`
49
+
sectionHelp:=`Sections define how inputs will be processed. Section names are case-insensitive and may contain parameters in (). The section order is standard > default > custom. The default value is [standard,default].
50
+
standard - standard section that Golang provides officially, like "fmt"
51
+
Prefix(github.com/daixiang0) - custom section, groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
52
+
default - default section, contains all rest imports`
0 commit comments