Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ linters:
- gocognit
- gocyclo
- gosec
- nolintlint

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: With its default settings, nolintlint doesn't enforce the rule this PR maps it to ("Every //nolint names the linter and carries a reason"). require-specific and require-explanation are both false by default, so a bare //nolint or //nolint:paralleltest with no // <reason> still passes. Only unused or malformed directives get reported. The PR description says nolintlint checks that a reason is present, but it won't until these are set:

  settings:
    nolintlint:
      require-specific: true
      require-explanation: true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

対応しました(14e007d).nolintlint に require-specific: true と require-explanation: true を設定し,golangci-lint run ./... は 0 issues です.

- paralleltest
- revive
settings:
gocognit:
min-complexity: 15
gocyclo:
min-complexity: 10
nolintlint:
require-explanation: true
require-specific: true
revive:
rules:
- name: package-comments
- name: exported
- name: argument-limit
arguments: [3]
- name: max-control-nesting
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Command template-go prints a greeting and serves as the starting point for new Go projects.
package main

import "fmt"
Expand Down
2 changes: 2 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ import (
)

func TestGreeting(t *testing.T) {
t.Parallel()

assert.Equal(t, "Hello, World!", greeting())
}
Loading