https://github.com/utgwkk/autonolint
Insert `//nolint` comment automatically for golangci-lint
https://github.com/utgwkk/autonolint
golangci-lint
Last synced: 3 months ago
JSON representation
Insert `//nolint` comment automatically for golangci-lint
- Host: GitHub
- URL: https://github.com/utgwkk/autonolint
- Owner: utgwkk
- License: mit
- Created: 2025-01-07T01:38:16.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-01-29T00:50:47.000Z (5 months ago)
- Last Synced: 2025-03-14T19:14:01.520Z (4 months ago)
- Topics: golangci-lint
- Language: Go
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# autonolint
Insert `//nolint` comment automatically for golangci-lint
## Installation
```console
$ go install github.com/utgwkk/autonolint/cmd/autonolint
```## Usage
1. Run golangci-lint with `--out-format=json`.
2. (Optional) Extract `Issues` field of JSON.
3. Pass to `autonolint` with standard input.```console
$ golangci-lint run --out-format=json | autonolint# Or:
$ golangci-lint run --out-format=json | jq .Issues | autonolint
```You can specify content of a comment for `//nolint` directive via `-comment` option.
```console
$ golangci-lint run --out-format=json | autonolint -comment "TODO: refactor"
```## DEMO
[](https://gyazo.com/82570c43fcaf57c6dcd9eff93fcb8b8e)