mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
Move errcheck excludes config
Eliminate the need for a second config file for golangci-lint config file by moving the list of errcheck exclude functions into the yaml config. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
parent
408f31f786
commit
8b01189327
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
|
@ -3,6 +3,7 @@ name: CI
|
|||
on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
test_go:
|
||||
name: Go tests
|
||||
|
|
|
@ -33,7 +33,18 @@ linters-settings:
|
|||
- io/ioutil: "Use corresponding 'os' or 'io' functions instead."
|
||||
- regexp: "Use github.com/grafana/regexp instead of regexp"
|
||||
errcheck:
|
||||
exclude: scripts/errcheck_excludes.txt
|
||||
exclude-functions:
|
||||
# Don't flag lines such as "io.Copy(io.Discard, resp.Body)".
|
||||
- io.Copy
|
||||
# The next two are used in HTTP handlers, any error is handled by the server itself.
|
||||
- io.WriteString
|
||||
- (net/http.ResponseWriter).Write
|
||||
# No need to check for errors on server's shutdown.
|
||||
- (*net/http.Server).Shutdown
|
||||
# Never check for logger errors.
|
||||
- (github.com/go-kit/log.Logger).Log
|
||||
# Never check for rollback errors as Rollback() is called when a previous error was detected.
|
||||
- (github.com/prometheus/prometheus/storage.Appender).Rollback
|
||||
goimports:
|
||||
local-prefixes: github.com/prometheus/prometheus
|
||||
gofumpt:
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
// Don't flag lines such as "io.Copy(io.Discard, resp.Body)".
|
||||
io.Copy
|
||||
// The next two are used in HTTP handlers, any error is handled by the server itself.
|
||||
io.WriteString
|
||||
(net/http.ResponseWriter).Write
|
||||
// No need to check for errors on server's shutdown.
|
||||
(*net/http.Server).Shutdown
|
||||
|
||||
// Never check for logger errors.
|
||||
(github.com/go-kit/log.Logger).Log
|
||||
|
||||
// Never check for rollback errors as Rollback() is called when a previous error was detected.
|
||||
(github.com/prometheus/prometheus/storage.Appender).Rollback
|
Loading…
Reference in a new issue