Skip to content

Commit

Permalink
Add reference to golangci-lint & nogo in intro.md and add nogo in `…
Browse files Browse the repository at this point in the history
…lint.md`
  • Loading branch information
autarch committed Feb 10, 2025
1 parent 5810c8c commit e8fb2ad
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-MongoDB.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
intro to use `gofumpt` instead.
- Added a recommendation to use `gopls` in general, and specifically to configure your editor to use
it to update imports.
- Added recommendations to use `golangci-lint` or `nogo` for linting orchestration.
6 changes: 6 additions & 0 deletions src/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ recommend setting up your editor to:
- Run `gofumpt` on save
- Run `revive` and `go vet` to check for errors

Note that you may wish to use [golangci-lint] or Bazel's [nogo] to run `gofumpt`, `revive`, and `go
vet` instead of running each one separately.

[golangci-lint]: https://golangci-lint.run/
[nogo]: https://github.com/bazel-contrib/rules_go/blob/master/go/nogo.rst

You can find information in editor support for Go tools here:
<https://go.dev/wiki/IDEsAndTextEditorPlugins>

Expand Down
6 changes: 5 additions & 1 deletion src/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ quality without being unnecessarily prescriptive:

## Lint Runners

We recommend [golangci-lint] as the go-to lint runner for Go code, largely due
For projects which use Bazel, you should use [nogo] instead of [golangci-lint], as [golangci-lint]
does not work well with Bazel's sandboxing.

Otherwise, we recommend [golangci-lint] as the go-to lint runner for Go code, largely due
to its performance in larger codebases and ability to configure and use many
canonical linters at once. This repo has an example [.golangci.yml] config file
with recommended linters and settings.
Expand All @@ -30,6 +33,7 @@ golangci-lint has [various linters] available for use. The above linters are
recommended as a base set, and we encourage teams to add any additional linters
that make sense for their projects.

[nogo]: https://github.com/bazel-contrib/rules_go/blob/master/go/nogo.rst
[golangci-lint]: https://github.com/golangci/golangci-lint
[.golangci.yml]: https://github.com/uber-go/guide/blob/master/.golangci.yml
[various linters]: https://golangci-lint.run/usage/linters/
7 changes: 6 additions & 1 deletion style.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ recommend setting up your editor to:
- Run `gofumpt` on save
- Run `revive` and `go vet` to check for errors

Note that you may wish to use [golangci-lint](https://golangci-lint.run/) or Bazel's [nogo](https://github.com/bazel-contrib/rules_go/blob/master/go/nogo.rst) to run `gofumpt`, `revive`, and `go vet` instead of running each one separately.

You can find information in editor support for Go tools here:
https://go.dev/wiki/IDEsAndTextEditorPlugins

Expand Down Expand Up @@ -4109,7 +4111,10 @@ quality without being unnecessarily prescriptive:

### Lint Runners

We recommend [golangci-lint](https://github.com/golangci/golangci-lint) as the go-to lint runner for Go code, largely due
For projects which use Bazel, you should use [nogo](https://github.com/bazel-contrib/rules_go/blob/master/go/nogo.rst) instead of [golangci-lint](https://github.com/golangci/golangci-lint), as [golangci-lint](https://github.com/golangci/golangci-lint)
does not work well with Bazel's sandboxing.

Otherwise, we recommend [golangci-lint](https://github.com/golangci/golangci-lint) as the go-to lint runner for Go code, largely due
to its performance in larger codebases and ability to configure and use many
canonical linters at once. This repo has an example [.golangci.yml](https://github.com/uber-go/guide/blob/master/.golangci.yml) config file
with recommended linters and settings.
Expand Down

0 comments on commit e8fb2ad

Please sign in to comment.