Skip to content

Instantly share code, notes, and snippets.

@pboothe
Created June 26, 2024 21:12
Show Gist options
  • Save pboothe/870d610aeafdcce304b8c22caccacc9c to your computer and use it in GitHub Desktop.
Save pboothe/870d610aeafdcce304b8c22caccacc9c to your computer and use it in GitHub Desktop.
run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 5m
# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 1
# Include test files or not.
# Default: true
tests: false
output:
# The formats used to render issues.
# Formats:
# - `colored-line-number`
# - `line-number`
# - `json`
# - `colored-tab`
# - `tab`
# - `html`
# - `checkstyle`
# - `code-climate`
# - `junit-xml`
# - `github-actions`
# - `teamcity`
# - `sarif`
# Output path can be either `stdout`, `stderr` or path to the file to write to.
#
# For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma.
# The output can be specified for each of them by separating format name and path by colon symbol.
# Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number"
# The CLI flag (`--out-format`) override the configuration file.
#
# Default:
# formats:
# - format: colored-line-number
# path: stdout
formats:
- format: colored-line-number
path: stdout
# Print lines of code with issue.
# Default: true
print-issued-lines: true
# Print linter name in the end of issue text.
# Default: true
print-linter-name: true
# Make issues output unique by line.
# Default: true
uniq-by-line: false
# Sort results by the order defined in `sort-order`.
# Default: false
sort-results: true
# Order to use when sorting results.
# Require `sort-results` to `true`.
# Possible values: `file`, `linter`, and `severity`.
#
# If the severity values are inside the following list, they are ordered in this order:
# 1. error
# 2. warning
# 3. high
# 4. medium
# 5. low
# Either they are sorted alphabetically.
#
# Default: ["file"]
sort-order:
- severity
- file # filepath, line, and column.
- linter
# Show statistics per linter.
# Default: false
show-stats: true
linters:
enable-all: true
disable:
- depguard # Not a tool I care about now
- wrapcheck # You don't have to always wrap errors
- testpackage # I support whitebox testing
- inamedparam # You shouldn't always need to name params in interfaces
- wsl # Buggy: wrong on "if x := thing; test(x) {"
- varnamelen # db is a good name for a database
- nlreturn # You don't need a blank line before every return
- gochecknoinits # init() isn't evil. Love of init() is.
- gochecknoglobals # globals aren't evil. Love of globals is. Also, prometheus metrics are all globals.
- ireturn # https://github.com/go-proverbs/go-proverbs.github.io/issues/37#issuecomment-571288298
- exhaustruct # HTTP servers (among others) are designed to be non-exhaustive
- funlen # Long functions are not as bad as we used to think.
# These are all deprecated
- deadcode
- exhaustivestruct
- golint
- ifshort
- interfacer
- maligned
- nosnakecase
- scopelint
- structcheck
- varcheck
linters-settings:
tagliatelle:
# Check the struck tag name case.
case:
# Use the struct field name to check the name of the struct tag.
# Default: false
use-field-name: true
rules:
# Any struct tag type can be used.
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `upperSnake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`.
json: goPascal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment