chore: add linters gocritic

main
sudo pacman -Syu 2022-11-20 21:20:04 +07:00
parent 16846319b0
commit e7feb0ccf9
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
2 changed files with 9 additions and 4 deletions

View File

@ -27,6 +27,7 @@ linters:
- errname - errname
- errorlint - errorlint
- execinquery - execinquery
- gocritic
- goerr113 - goerr113
- gofumpt - gofumpt
- gosec - gosec
@ -68,3 +69,7 @@ linters-settings:
- unusedresult - unusedresult
staticcheck: staticcheck:
checks: ["all", "-SA1019"] checks: ["all", "-SA1019"]
gocritic:
enabled-tags:
- style
- performance

View File

@ -140,10 +140,10 @@ func (a *action) generateMarkdownChangelog(output, version string, commits []con
} }
// Generate markdown from commits // Generate markdown from commits
newNodes := changelog.GenerateMarkdown(commits, a.flags.scopes, version, time.Now()) nodes := changelog.GenerateMarkdown(commits, a.flags.scopes, version, time.Now())
// Final changelog with new commits above old commits // Final changelog with new commits above old commits
nodes := append(newNodes, oldNodes...) nodes = append(nodes, oldNodes...)
changelogText := markdown.GenerateText(nodes) changelogText := markdown.GenerateText(nodes)
// Demo run // Demo run
@ -172,10 +172,10 @@ func (a *action) generateRSTChangelog(output, version string, commits []conventi
} }
// Generate markdown from commits // Generate markdown from commits
newNodes := changelog.GenerateRST(commits, a.flags.scopes, version, time.Now()) nodes := changelog.GenerateRST(commits, a.flags.scopes, version, time.Now())
// Final changelog with new commits above old commits // Final changelog with new commits above old commits
nodes := append(newNodes, oldNodes...) nodes = append(nodes, oldNodes...)
changelogText := rst.GenerateText(nodes) changelogText := rst.GenerateText(nodes)
// Demo run // Demo run