matryer / moq

Interface mocking tool for go generate
http://bit.ly/meetmoq
MIT License
2k stars 127 forks source link

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

Closed nahojer closed 3 years ago

nahojer commented 3 years ago

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.

sudo-suhas commented 3 years ago

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.
nahojer commented 3 years ago

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.