This repository has been archived on 2023-11-08. You can view files and clone it, but cannot push or open issues/pull-requests.
2020-05-06 22:05:00 +00:00
|
|
|
# imp
|
|
|
|
|
|
|
|
imp is an opinionated import formatter
|
|
|
|
|
|
|
|
The order it follows is:
|
|
|
|
```text
|
|
|
|
import (
|
|
|
|
<stdlib>
|
|
|
|
|
|
|
|
<this module's packages>
|
|
|
|
|
|
|
|
<other module's packages>
|
|
|
|
)
|
|
|
|
```
|
|
|
|
|
2023-07-16 19:49:44 +00:00
|
|
|
imp includes five flags:
|
2020-05-06 22:05:00 +00:00
|
|
|
|
|
|
|
* `--write` will write out the formatting rather than printing
|
2022-08-09 18:46:36 +00:00
|
|
|
* `--ignore` reads a `.impignore` file for globs to include/exclude (`.impignore` by default)
|
2023-07-16 19:49:44 +00:00
|
|
|
* `--stdin` will read from stdin and print to stdout
|
|
|
|
* `--gofumpt` will also format using [gofumpt](https://github.com/mvdan/gofumpt)
|
|
|
|
* `--gofumpt-extra` will include [gofumpt extra rules](https://github.com/mvdan/gofumpt#extra-rules-behind--extra)
|
2020-05-07 01:00:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
### `.impignore` format
|
|
|
|
|
|
|
|
The `.impignore` file follows a [globber format](https://gitea.com/jolheiser/globber),
|
2022-08-09 18:46:36 +00:00
|
|
|
which closely resembles a traditional `.gitignore` file.
|