matryer / moq

Interface mocking tool for go generate

Home Page:http://bit.ly/meetmoq

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option to specify package comment conforming to the standard format?

nahojer opened this issue · comments

Thank you for letting me generate readable and simple mocks!

Is it possible to get an option to do something like this?

// Package mypkg ...
//
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq

package mypkg

The reason for wanting this is to suppress linters without having to clutter my codebase with config files.

But linters ignore generated files. From the docs of golangci-lint:

  # ... there is no need to include all autogenerated files, we confidently recognize
  # autogenerated files. If it's not please let us know.

I use staticcheck which have deprecated file ignore patterns in config files and doesn't seem to have any intention to add this to their linter. For now I have just disabled the package comment rule (ST1000), although I would really like the rule for non-generated/test files

But I should probably switch to golanci-lint. Had a look at it's documentation and it seems to support everything I want. Thank you.