Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
Note: You can use `golangci-lint config verify` to check if the
`.golangci.yml` config matches the published schema.

- `tenv` has been deprecated in favour of `usetesting`
- `allow-leading-space` has been removed from `nolintlint`: golangci/golangci-lint#3063
- `revive` doesn't have `error-code` `warning-code` as config
options (see https://golangci-lint.run/usage/linters/#revive).
There's some discussion mgechev/revive#241
about adding `set_exit_status` to `revive`, but it's not exposed
via `golangci-lint`

Signed-off-by: Mihai Todor <todormihai@gmail.com>
  • Loading branch information
mihaitodor committed Mar 9, 2025
1 parent f30c518 commit dd735c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ linters:
- revive
- rowserrcheck
- sqlclosecheck
- tenv
- usetesting
- unconvert
- unparam
- wastedassign
Expand All @@ -54,7 +54,6 @@ linters-settings:

# If we want to opt out of a lint, we require an explanation.
nolintlint:
allow-leading-space: true
allow-unused: false
require-explanation: true
require-specific: true
Expand Down Expand Up @@ -114,8 +113,6 @@ linters-settings:
ignore-generated-header: true
severity: warning
confidence: 0.8
error-code: 0
warning-code: 0
rules:
- name: atomic
- name: blank-imports
Expand Down
6 changes: 3 additions & 3 deletions generate/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ func (s Struct) WriteDefault(l *LineWriter) {

func (s Struct) WriteDefn(l *LineWriter) {
if s.Comment != "" {
l.Write(s.Comment) //nolint:govet // ...
l.Write(s.Comment)
}
l.Write("type %s struct {", s.Name)
if s.TopLevel {
Expand Down Expand Up @@ -822,15 +822,15 @@ func (s Struct) WriteNewPtrFunc(l *LineWriter) {

func (e Enum) WriteDefn(l *LineWriter) {
if e.Comment != "" {
l.Write(e.Comment) //nolint:govet // ...
l.Write(e.Comment)
l.Write("// ")
}
l.Write("// Possible values and their meanings:")
l.Write("// ")
for _, v := range e.Values {
l.Write("// * %d (%s)", v.Value, v.Word)
if len(v.Comment) > 0 {
l.Write(v.Comment) //nolint:govet // ...
l.Write(v.Comment)
}
l.Write("//")
}
Expand Down

0 comments on commit dd735c5

Please sign in to comment.