Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
27 changes: 25 additions & 2 deletions time/.golangci.yml → .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ linters:
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL.
- perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative.
- prealloc # Finds slice declarations that could potentially be pre-allocated.
- protogetter # Reports direct reads from proto message fields when getters should be used.
- reassign # Checks that package variables are not reassigned.
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go.
- staticcheck # It's a set of rules from staticcheck.
Expand Down Expand Up @@ -89,6 +90,23 @@ linters:
- text: 'ctx is never used'
linters: [ staticcheck ]

# Per-module exceptions.

# `iface: unused` is not enabled for these modules.
- path: '^(closer|dispatcher|prommetrics)/'
linters: [ iface ]
text: '^unused: interface'

# `iface: opaque` is not enabled for these modules.
- path: '^ctxkey/'
linters: [ iface ]
text: '^opaque: '

# `gocritic: hugeParam` is not enabled for these modules.
- path: '^prommetrics/'
linters: [ gocritic ]
text: '^hugeParam: opts is heavy'

paths:
- \\.git$
- assets$
Expand Down Expand Up @@ -240,7 +258,7 @@ linters:
## PERFORMANCE
- appendCombine # Detects append chains to the same slice that can be done in a single append call.
- equalFold # Detects unoptimal strings/bytes case-insensitive comparison.
# hugeParam # Detects params that incur excessive amount of copying.
- hugeParam # Detects params that incur excessive amount of copying.
- indexAlloc # Detects strings.Index calls that may cause unwanted allocs.
- preferDecodeRune # Detects expressions like []rune(s)[0] that may cause unwanted rune slice allocation.
- preferFprint # Detects fmt.Sprint(f/ln) calls which can be replaced with fmt.Fprint(f/ln).
Expand All @@ -253,7 +271,7 @@ linters:
- zeroByteRepeat # Detects bytes.Repeat with 0 value.

goheader:
template-path: ../.github/goheader.tmpl
template-path: ${config-path}/.github/goheader.tmpl

gomoddirectives:
replace-local: true
Expand Down Expand Up @@ -290,6 +308,11 @@ linters:
prealloc:
range-loops: true

protogetter:
skip-files:
- '*/vendor/*'
skip-any-generated: true

reassign:
patterns:
- '.*'
Expand Down
345 changes: 0 additions & 345 deletions closer/.golangci.yml

This file was deleted.

3 changes: 2 additions & 1 deletion closer/closer.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,12 @@ func (c *closer) CloseAll() { //nolint:gocognit
}

errs := make([]error, 0, len(*funcs))
for i := 0; i < cap(errs); i++ {
for i := 0; i < len(*funcs); i++ {
if err := <-errCh; err != nil {
errs = append(errs, err)
}
}

if len(errs) > 0 {
c.err.Store(errors.Join(errs...))
}
Expand Down
345 changes: 0 additions & 345 deletions ctxkey/.golangci.yml

This file was deleted.

346 changes: 0 additions & 346 deletions deferred/.golangci.yml

This file was deleted.

345 changes: 0 additions & 345 deletions dispatcher/.golangci.yml

This file was deleted.

345 changes: 0 additions & 345 deletions prommetrics/.golangci.yml

This file was deleted.

345 changes: 0 additions & 345 deletions prommetrics/exemplar/.golangci.yml

This file was deleted.

352 changes: 0 additions & 352 deletions protomap/.golangci.yml

This file was deleted.

353 changes: 0 additions & 353 deletions slogger/.golangci.yml

This file was deleted.

353 changes: 0 additions & 353 deletions slogger/grpcslog/.golangci.yml

This file was deleted.

346 changes: 0 additions & 346 deletions strcase/.golangci.yml

This file was deleted.

4 changes: 2 additions & 2 deletions strcase/strcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func Detect(s string) Mode {

// detectCore detects the case of a string without the leading and the trailing
// separators.
func detectCore(s string) Mode {
func detectCore(s string) Mode { //nolint:gocognit
if s == "" {
return FlatCase // FlatCase used as a fallback value
}
Expand Down Expand Up @@ -223,7 +223,7 @@ func toCamel(s string, sep rune) string {
// given separator, lowercasing the result.
//
// The abbreviations are handled: "ReadJSONData" becomes "read_json_data".
func fromCamel(s string, sep rune) string {
func fromCamel(s string, sep rune) string { //nolint:gocognit
if s == "" {
return ""
}
Expand Down
346 changes: 0 additions & 346 deletions sync/.golangci.yml

This file was deleted.

Loading