Skip to content

Commit

Permalink
proto wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
a-menshchikov committed Nov 12, 2024
1 parent 3002ac4 commit ec9a404
Show file tree
Hide file tree
Showing 10 changed files with 847 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

env:
GO_VERSION: stable
GOLANGCI_LINT_VERSION: v1.61
GOLANGCI_LINT_VERSION: v1.62

jobs:
detect-modules:
Expand Down
230 changes: 194 additions & 36 deletions closer/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,25 @@
output:
formats:
- format: colored-line-number
print-issued-lines: true
print-linter-name: true

linters-settings:
gocognit:
min-complexity: 10
goconst:
min-len: 2
min-occurrences: 2
gosec:
excludes:
# _ instead of err checks
- G104
govet:
enable-all: true
nakedret:
max-func-lines: 10
nolintlint:
require-specific: true
prealloc:
range-loops: true
revive:
rules:
- name: unexported-return
disabled: true
staticcheck:
# SA5001: Allow to ignore returned error before deferring *.Close()
checks: ["all", "-SA5001"]
run:
concurrency: 8
timeout: 10m

linters:
disable-all: true
enable:
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- contextcheck
- copyloopvar
- durationcheck
- errcheck
- errname
- errorlint
- exportloopref
- gocheckcompilerdirectives
- gocognit
- goconst
- gocritic
- gofmt
- goimports
- gosec
- gosimple
Expand All @@ -48,21 +28,199 @@ linters:
- makezero
- mnd
- nakedret
- nilnil
- noctx
- nolintlint
- nosprintfhostport
- perfsprint
- prealloc
- revive
- staticcheck
- tenv
- testpackage
- typecheck
- unconvert
- unused
- usestdlibvars
- wastedassign

linters-settings:
gocognit:
min-complexity: 10

goconst:
min-len: 2
min-occurrences: 2

gocritic:
disable-all: true
enabled-checks:
## DIAGNOSTIC
- appendAssign
- argOrder
- badCall
- badCond
- badLock
- badRegexp
- badSorting
- badSyncOnceFunc
- builtinShadowDecl
- caseOrder
- codegenComment
- commentedOutCode
- deferInLoop
- deprecatedComment
- dupArg
- dupBranchBody
- dupCase
- dupSubExpr
- dynamicFmtString
- emptyDecl
- evalOrder
- exitAfterDefer
- externalErrorReassign
- filepathJoin
- flagDeref
- flagName
- mapKey
- nilValReturn
- offBy1
- rangeAppendAll
- regexpPattern
- returnAfterHttpError
- sloppyLen
- sloppyReassign
- sloppyTypeAssert
- sortSlice
- sprintfQuotedString
- sqlQuery
- syncMapLoadAndDelete
- truncateCmp
- uncheckedInlineErr
- unnecessaryDefer
- weakCond

## STYLE
- assignOp
- boolExprSimplify
- builtinShadow
- captLocal
- commentFormatting
- commentedOutImport
- defaultCaseOrder
- deferUnlambda
- docStub
- dupImport
- elseif
- emptyFallthrough
- emptyStringTest
- exposedSyncMutex
- hexLiteral
- httpNoBody
- ifElseChain
- importShadow
- initClause
- methodExprCall
- nestingReduce
- newDeref
- octalLiteral
- paramTypeCombine
- preferFilepathJoin
- ptrToRefParam
- redundantSprint
- regexpMust
- regexpSimplify
- singleCaseSwitch
- stringConcatSimplify
- stringsCompare
- switchTrue
- timeExprSimplify
- todoCommentWithoutDetail
# tooManyResultsChecker
- typeAssertChain
- typeDefFirst
- typeSwitchVar
- typeUnparen
- underef
- unlabelStmt
- unlambda
# unnamedResult
# unnecessaryBlock
- unslice
- valSwap
# whyNoLint
- wrapperFunc
- yodaStyleExpr

## PERFORMANCE
- appendCombine
- equalFold
# hugeParam
- indexAlloc
- preferDecodeRune
- preferFprint
- preferStringWriter
- preferWriteByte
- rangeExprCopy
- rangeValCopy
- sliceClear
- stringXbytes

gofmt:
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'

gosec:
excludes:
# _ instead of err checks
- G104

govet:
enable-all: true

nakedret:
max-func-lines: 10

nolintlint:
require-specific: true

prealloc:
range-loops: true

revive:
severity: error
rules:
- name: atomic
- name: confusing-naming
- name: confusing-results
- name: constant-logical-expr
- name: context-keys-type
- name: deep-exit
- name: early-return
- name: empty-block
- name: empty-lines
- name: error-return
- name: error-strings
- name: errorf
- name: identical-branches
- name: if-return
- name: increment-decrement
- name: range
- name: redefines-builtin-id
- name: string-of-int
- name: unnecessary-stmt
- name: unreachable-code
- name: waitgroup-by-value

issues:
max-issues-per-linter: 0
max-same-issues: 0

include:
- EXC0001

exclude-rules:
- path: '(.+)_test\.go'
linters:
- gocognit
- text: 'Error return value of .((os\.)?std(out|err)\..*|.*print(f|ln)?). is not checked'
linters: [ errcheck ]
- path: (.+)_test\.go
linters: [ gocognit, mnd ]
Loading

0 comments on commit ec9a404

Please sign in to comment.