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

Add tests for inefficient string formatting #2878

Merged
merged 4 commits into from
Mar 27, 2024
Merged
Changes from 1 commit
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
Next Next commit
Add tests for inefficient string formatting
  • Loading branch information
StephenButtolph committed Mar 27, 2024
commit a2cd510c6498f4f0a917756512ac2db16442e138
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ linters-settings:
- name: string-format
disabled: false
arguments:
- ["b.Logf[0]", "/.*%.*/", "no format directive, use b.Log instead"]
- ["fmt.Errorf[0]", "/.*%.*/", "no format directive, use errors.New instead"]
- ["fmt.Fprintf[1]", "/.*%.*/", "no format directive, use fmt.Fprint instead"]
- ["fmt.Printf[0]", "/.*%.*/", "no format directive, use fmt.Print instead"]
- ["fmt.Sprintf[0]", "/.*%.*/", "no format directive, use fmt.Sprint instead"]
- ["log.Fatalf[0]", "/.*%.*/", "no format directive, use log.Fatal instead"]
- ["log.Printf[0]", "/.*%.*/", "no format directive, use log.Print instead"]
- ["t.Logf[0]", "/.*%.*/", "no format directive, use t.Log instead"]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag
- name: struct-tag
disabled: false
Expand Down
Loading