An open API service indexing awesome lists of open source software.

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

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

[![Image from Gyazo](https://i.gyazo.com/82570c43fcaf57c6dcd9eff93fcb8b8e.gif)](https://gyazo.com/82570c43fcaf57c6dcd9eff93fcb8b8e)