Releases: daixiang0/gci
Releases · daixiang0/gci
v0.4.2
This version includes some bug fixes, thanks to everyone who reported bugs, all of you make GCI better!
What's Changed
- fix extra linkbreak in the end by @daixiang0 in #73
- fix linebreak issue by @daixiang0 in #75
- fix same custom sections by @daixiang0 in #77
- fix one import case by @daixiang0 in #78
Full Changelog: v0.4.1...v0.4.2
v0.4.1
v0.4.0
What's Changed
- refactor parse with AST
- simplify section logic
- desperate rarely used flags
- all configs are not case sensitive
- support skip generated files
Breaking Changes
- the priority of the section is standard>custom>default
- all import blocks use one TAB(\t) as Indent
Please check README to get more details.
v0.3.4
What's Changed
- Update codes and re-enable in golangci-lint by @daixiang0 in #64
Full Changelog: v0.3.3...v0.3.4
v0.3.3
What's Changed
- replace log with logrus by @glightfoot in #52
- Support go1.18 standard packages by @Dreamacro in #57
New Contributors
- @glightfoot made their first contribution in #52
- @Dreamacro made their first contribution in #57
Full Changelog: v0.3.2...v0.3.3
v0.3.2
What's Changed
- Fix issue parsing block comments, and always retain prefix comments for cgo imports. by @charleskorn in #49
New Contributors
- @charleskorn made their first contribution in #49
v0.3.1
v0.3.0
New features are coming on the occasion of the Chineses new year!
Great contribution from @ngehrsitz, thanks!
Now GCI supports three modes of operation:
$ gci print -h
Print outputs the formatted file. If you want to apply the changes to a file use write instead!
Usage:
gci print path... [flags]
Aliases:
print, output
Flags:
--NoInlineComments Drops inline comments while formatting
--NoPrefixComments Drops comment lines above an import statement while formatting
-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.
Comment(your text here) | CommentLine(your text here) - Prints the specified indented comment
Def | Default - Contains all imports that could not be matched to another section type
NL | NewLine - Prints an empty line
Prefix(gitlab.com/myorg) | pkgPrefix(gitlab.com/myorg) - Groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
Std | Standard - Captures all standard packages if they do not match another section
(default [Standard,Default])
-x, --SectionSeparator strings SectionSeparators are inserted between Sections (default [NewLine])
-h, --help help for print
$ gci write -h
Write modifies the specified files in-place
Usage:
gci write path... [flags]
Aliases:
write, overwrite
Flags:
--NoInlineComments Drops inline comments while formatting
--NoPrefixComments Drops comment lines above an import statement while formatting
-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.
Comment(your text here) | CommentLine(your text here) - Prints the specified indented comment
Def | Default - Contains all imports that could not be matched to another section type
NL | NewLine - Prints an empty line
Prefix(gitlab.com/myorg) | pkgPrefix(gitlab.com/myorg) - Groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
Std | Standard - Captures all standard packages if they do not match another section
(default [Standard,Default])
-x, --SectionSeparator strings SectionSeparators are inserted between Sections (default [NewLine])
-h, --help help for write
$ gci diff -h
Diff prints a patch in the style of the diff tool that contains the required changes to the file to make it adhere to the specified formatting.
Usage:
gci diff path... [flags]
Flags:
--NoInlineComments Drops inline comments while formatting
--NoPrefixComments Drops comment lines above an import statement while formatting
-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.
Comment(your text here) | CommentLine(your text here) - Prints the specified indented comment
Def | Default - Contains all imports that could not be matched to another section type
NL | NewLine - Prints an empty line
Prefix(gitlab.com/myorg) | pkgPrefix(gitlab.com/myorg) - Groups all imports with the specified Prefix. Imports will be matched to the longest Prefix.
Std | Standard - Captures all standard packages if they do not match another section
(default [Standard,Default])
-x, --SectionSeparator strings SectionSeparators are inserted between Sections (default [NewLine])
-d, --debug Enables debug output from the formatter
-h, --help help for diff
Support for the old CLI style is still present if you do not specify the subcommands. The only difference is that --local
requires two dashes now.