Skip to content

Commit

Permalink
.golangci.yml: update linter rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ellemouton committed Nov 21, 2023
1 parent a6dd981 commit 013e964
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,42 @@ linters-settings:
govet:
# Don't report about shadowed variables
check-shadowing: false

gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true

funlen:
# Checks the number of lines in a function.
# If lower than 0, disable the check.
lines: 200
# Checks the number of statements in a function.
statements: 80

gosec:
excludes:
- G402 # Look for bad TLS connection settings.
- G306 # Poor file permissions used when writing to a new file.

whitespace:
multi-func: true
multi-if: true

linters:
enable-all: true
disable:
# Allow dynamic errors.
- goerr113

# We want to allow short variable names.
- varnamelen

# Allow tests to be put in the same package.
- testpackage

# We want to allow TODOs.
- godox

# Init functions are used by loggers throughout the codebase.
- gochecknoinits

Expand All @@ -46,6 +65,17 @@ linters:
# instances are created.
- exhaustruct

# Disable gofumpt as it has weird behavior regarding formatting multiple
# lines for a function which is in conflict with our contribution
# guidelines. See https://github.com/mvdan/gofumpt/issues/235.
- gofumpt

# Disable whitespace linter as it has conflict rules against our
# contribution guidelines. See https://github.com/bombsimon/wsl/issues/109.
#
# TODO: bring it back when the above issue is fixed.
- wsl

# Deprecated linters. See https://golangci-lint.run/usage/linters/.
- interfacer
- golint
Expand Down

0 comments on commit 013e964

Please sign in to comment.