Skip to content

Commit

Permalink
Lint against fmt.Println except in main.go (#98)
Browse files Browse the repository at this point in the history
## Summary:
Usually this is an artifact of debugging, not intentional!  And it's
come up a few times, luckily all noticed by reviewers.

## Test plan:
make check


Author: benjaminjkraft

Reviewers: dnerdy, jvoll

Required Reviewers: 

Approved By: dnerdy

Checks: ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Lint, ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Lint

Pull Request URL: #98
  • Loading branch information
benjaminjkraft authored Sep 16, 2021
1 parent ce079a7 commit 463cffd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ linters:
- unconvert
- unparam
- whitespace
- forbidigo

linters-settings:
errcheck:
Expand All @@ -52,6 +53,12 @@ linters-settings:
- gopkg.in/yaml.v2
- github.com/alexflint/go-arg

forbidigo:
forbid:
- '^print(|f|ln)$'
- '^fmt\.Print(|f|ln)$'


gocritic:
# Which checks should be enabled:
# See https://go-critic.github.io/overview#checks-overview
Expand Down Expand Up @@ -82,7 +89,12 @@ issues:
# Test-only deps are not restricted.
- linters:
- depguard
path: _test\.go$|internal/testutil/|internal/integration/
path: _test\.go$|^internal/testutil/|^internal/integration/

# Ok to use fmt.Print in the examples, and in the CLI entrypoint.
- linters:
- forbidigo
path: ^example/|^generate/main\.go$

- linters:
- errcheck
Expand Down

0 comments on commit 463cffd

Please sign in to comment.