Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump github.com/go-critic/go-critic from 0.5.6 to 0.6.1 #2041

Merged
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
8 changes: 7 additions & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
# TODO: Enable for javascript later
language: [ 'go' ]
golang: [ '1.16' ]
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

Expand All @@ -42,6 +43,11 @@ jobs:
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
Expand All @@ -56,4 +62,4 @@ jobs:
- run: make build test

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v1
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ jobs:
strategy:
matrix:
golang:
- 1.15
- 1.16
- 1.17
steps:
Expand Down
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ linters-settings:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
lll:
line-length: 140
maligned:
suggest-new: true
misspell:
locale: US
nolintlint:
Expand Down Expand Up @@ -117,6 +115,9 @@ linters:
# - wsl

issues:
exclude:
# disable this rule for go1.15 compatibility
- 'ioutilDeprecated:'
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
Expand All @@ -141,7 +142,6 @@ issues:
linters:
- gomnd


run:
skip-dirs:
- test/testdata_etc
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/golangci/golangci-lint

go 1.15
go 1.16

require (
4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a
Expand All @@ -21,7 +21,7 @@ require (
github.com/esimonov/ifshort v1.0.2
github.com/fatih/color v1.13.0
github.com/fzipp/gocyclo v0.3.1
github.com/go-critic/go-critic v0.5.6
github.com/go-critic/go-critic v0.6.1
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b
github.com/gofrs/flock v0.8.1
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
Expand Down
15 changes: 8 additions & 7 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[context.production.environment]
GO_VERSION = "1.15"
GO_VERSION = "1.16"

[context.deploy-preview.environment]
GO_VERSION = "1.15"
GO_VERSION = "1.16"

[context.branch-deploy.environment]
GO_VERSION = "1.15"
GO_VERSION = "1.16"
2 changes: 1 addition & 1 deletion pkg/golinters/goanalysis/runner_loadingpackage.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,6 @@ func sizeOfReflectValueTreeBytes(rv reflect.Value, visitedPtrs map[uintptr]struc
case reflect.Invalid:
return 0
default:
panic("unknown rv of type " + fmt.Sprint(rv))
panic("unknown rv of type " + rv.String())
}
}
2 changes: 1 addition & 1 deletion pkg/golinters/gocritic.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewGocritic() *goanalysis.Linter {
}
return goanalysis.NewLinter(
gocriticName,
`Provides many diagnostics that check for bugs, performance and style issues.
`Provides diagnostics that check for bugs, performance and style issues.
Extensible without recompilation through dynamic rules.
Dynamic rules are written declaratively with AST patterns, filters, report message and optional suggestion.`,
[]*analysis.Analyzer{analyzer},
Expand Down
2 changes: 1 addition & 1 deletion pkg/result/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (i *Issue) Fingerprint() string {
}

hash := md5.New() //nolint:gosec
_, _ = hash.Write([]byte(fmt.Sprintf("%s%s%s", i.Pos.Filename, i.Text, firstLine)))
_, _ = fmt.Fprintf(hash, "%s%s%s", i.Pos.Filename, i.Text, firstLine)

return fmt.Sprintf("%X", hash.Sum(nil))
}
8 changes: 4 additions & 4 deletions pkg/timeutils/stopwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ const noStagesText = "no stages"
type Stopwatch struct {
name string
startedAt time.Time
stages map[string]time.Duration
log logutils.Log

sync.Mutex
stages map[string]time.Duration
mu sync.Mutex
}

func NewStopwatch(name string, log logutils.Log) *Stopwatch {
Expand Down Expand Up @@ -110,7 +110,7 @@ func (s *Stopwatch) TrackStage(name string, f func()) {
startedAt := time.Now()
f()

s.Lock()
s.mu.Lock()
s.stages[name] += time.Since(startedAt)
s.Unlock()
s.mu.Unlock()
}
4 changes: 2 additions & 2 deletions scripts/expand_website_templates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func getLatestVersion() (string, error) {
req, err := http.NewRequest( // nolint:noctx
http.MethodGet,
"https://api.github.com/repos/golangci/golangci-lint/releases/latest",
nil,
http.NoBody,
)
if err != nil {
return "", fmt.Errorf("failed to prepare a http request: %s", err)
Expand Down Expand Up @@ -286,7 +286,7 @@ func check(b bool, title string) string {
}

func span(title, icon string) string {
return fmt.Sprintf(`<span title="%s">%s</span>`, title, icon)
return fmt.Sprintf(`<span title=%q>%s</span>`, title, icon)
}

func getThanksList() string {
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen_github_action_config/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/golangci/golangci-lint/scripts/gen_github_action_config

go 1.15
go 1.16

require (
github.com/shurcooL/githubv4 v0.0.0-20200627185320-e003124d66e4
Expand Down