rotblauer / gofmt-att

gofmt -w * ...
Apache License 2.0
6 stars 1 forks source link

robot should not format vendored code #3

Open rhysh opened 6 years ago

rhysh commented 6 years ago

Hello, I'm coming here from https://github.com/twitchtv/twirp/pull/114

That pull request changes two lines in code that was vendored by retool to the "_tools" directory.

Our copy of that code is not the right one to change. It should be changed upstream if at all. The robot doesn't need to know about retool, but should know to ignore directories that don't match go doc packages' "..." pattern.

It sounds like @whilei has fixed this already.

whilei commented 6 years ago

Just noting for reference:

// isGenerated reports whether the source file is generated code
// according the rules from https://golang.org/s/generatedcode.

https://github.com/golang/lint/blob/85993ffd0a6cd043291f3f63d45d656d97b165bd/lint.go#L123-L134 Found here https://blog.mgechev.com/2018/05/28/revive-golang-golint-linter/