walle / lll

Line length linter
MIT License
65 stars 9 forks source link

Ignore go generate directives #13

Open Antonboom opened 3 years ago

Antonboom commented 3 years ago

Hello!

We now have to do this, which is not very beautiful

//nolint:lll
//go:generate mockgen -source=$GOFILE --build_flags=-mod=mod -destination mocks/mocks.go -package eventsubscriptionmocks . IAvailability,IMarketsConfig,ILPClient
Antonboom commented 3 years ago

Just now noticed the --exclude option 🤦

And in golangci-lint:

    # Exclude lll issues for long lines with go:generate
    - linters:
        - lll
      source: "^//go:generate "

Most likely this PR can be closed. Although it seems like ignoring go generate directive is normal behavior (like ignoring files created with it).

I'll leave it up to you.

Thanks!

Antonboom commented 1 year ago

Implemented on golangci-lint side – https://github.com/golangci/golangci-lint/pull/3572