livebud / bud

The Full-Stack Web Framework for Go
MIT License
5.57k stars 180 forks source link

generated app directory fails linting with golangci-lint #331

Open sneak opened 1 year ago

sneak commented 1 year ago
golangci-lint run --fix
bud/internal/app/main.go:74:19: Error return value of `budClient.Publish` is not checked (errcheck)
    budClient.Publish("app:ready", nil)

As part of CI I run a linting of my repository. I suggest adding the line //nolint at the top of the template for bud/internal/app/main.go, as well as any other bud-managed template boilerplate files. This way any linters people use will ignore these files (without having to do special configuration to exclude the bud directory like is already automagically done in the .gitignore.)

matthewmueller commented 1 year ago

Oh that's neat! I actually think we should lint these files? If that's the only issue reported, that's an easy fix.

Longer-term we'd want lints to be run on the generated test code, so it'd block a release. For now, I'd suggest fixing that one case, then keeping an eye on it. If it becomes more unwieldy, I'm also open to //nolint comments, but I do want the generated code to be as good as possible.