onasty/.golangci.yaml (view raw)
Smirnov Oleksandr
Smirnov Oleksandr
ss2316544@gmail.com feat: keep metadate on note removal (#96)..., 1 year ago
ss2316544@gmail.com feat: keep metadate on note removal (#96)..., 1 year ago
| 1 | version: "2" |
| 2 | run: |
| 3 | tests: true |
| 4 | |
| 5 | linters: |
| 6 | default: none |
| 7 | enable: |
| 8 | - errcheck # checking for unchecked errors |
| 9 | - govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string |
| 10 | - staticcheck # is a go vet on steroids, applying a ton of static analysis checks |
| 11 | - ineffassign # detects when assignments to existing variables are not used |
| 12 | - unused # checks for unused constants, variables, functions and types |
| 13 | - asasalint # checks for pass []any as any in variadic func(...any) |
| 14 | - asciicheck # checks that your code does not contain non-ASCII identifiers |
| 15 | - bidichk # checks for dangerous unicode character sequences |
| 16 | - bodyclose # checks whether HTTP response body is closed successfully |
| 17 | - cyclop # checks function and package cyclomatic complexity |
| 18 | - dupl # tool for code clone detection |
| 19 | - durationcheck # checks for two durations multiplied together |
| 20 | - errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error |
| 21 | - errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13 |
| 22 | - exhaustive # checks exhaustiveness of enum switch statements |
| 23 | - forbidigo # forbids identifiers |
| 24 | - funlen # tool for detection of long functions |
| 25 | - gocheckcompilerdirectives # validates go compiler directive comments (//go:) |
| 26 | - gochecknoinits # checks that no init functions are present in Go code |
| 27 | - gochecksumtype # checks exhaustiveness on Go "sum types" |
| 28 | - goconst # finds repeated strings that could be replaced by a constant |
| 29 | - gocritic # provides diagnostics that check for bugs, performance and style issues |
| 30 | - gocyclo # computes and checks the cyclomatic complexity of functions |
| 31 | - gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod |
| 32 | - goprintffuncname # checks that printf-like functions are named with f at the end |
| 33 | - gosec # inspects source code for security problems |
| 34 | - lll # reports long lines |
| 35 | - loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap) |
| 36 | - makezero # finds slice declarations with non-zero initial length |
| 37 | - mirror # reports wrong mirror patterns of bytes/strings usage |
| 38 | - musttag # enforces field tags in (un)marshaled structs |
| 39 | - nakedret # finds naked returns in functions greater than a specified function length |
| 40 | - nestif # reports deeply nested if statements |
| 41 | - nilerr # finds the code that returns nil even if it checks that the error is not nil |
| 42 | - nilnil # checks that there is no simultaneous return of nil error and an invalid value |
| 43 | - noctx # finds sending http request without context.Context |
| 44 | - nolintlint # reports ill-formed or insufficient nolint directives |
| 45 | - nonamedreturns # reports all named returns |
| 46 | - nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL |
| 47 | - perfsprint # checks that fmt.Sprintf can be replaced with a faster alternative |
| 48 | - predeclared # finds code that shadows one of Go's predeclared identifiers |
| 49 | - promlinter # checks Prometheus metrics naming via promlint |
| 50 | - protogetter # reports direct reads from proto message fields when getters should be used |
| 51 | - reassign # checks that package variables are not reassigned |
| 52 | - revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint |
| 53 | - rowserrcheck # checks whether Err of rows is checked successfully |
| 54 | - sloglint # ensure consistent code style when using log/slog |
| 55 | - sqlclosecheck # checks that sql.Rows and sql.Stmt are closed |
| 56 | - testableexamples # checks if examples are testable (have an expected output) |
| 57 | - testifylint # checks usage of github.com/stretchr/testify |
| 58 | - tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes |
| 59 | - unconvert # removes unnecessary type conversions |
| 60 | - unparam # reports unused function parameters |
| 61 | - usestdlibvars # detects the possibility to use variables/constants from the Go standard library |
| 62 | - wastedassign # finds wasted assignment statements |
| 63 | - whitespace # detects leading and trailing whitespace |
| 64 | - inamedparam # peports interfaces with unnamed method parameters |
| 65 | - forcetypeassert # finds forced type assertions. |
| 66 | - exhaustruct # checks if all structure fields are initialized. |
| 67 | - err113 # forbids usage of dynamic errors |
| 68 | - contextcheck # check whether the function uses a non-inherited context |
| 69 | - ireturn # accept interfaces, return concrete types |
| 70 | |
| 71 | settings: |
| 72 | cyclop: |
| 73 | max-complexity: 30 |
| 74 | package-average: 10 |
| 75 | |
| 76 | errcheck: |
| 77 | check-type-assertions: true |
| 78 | |
| 79 | exhaustruct: |
| 80 | exclude: |
| 81 | - log/slog\.HandlerOptions |
| 82 | - net/http\.Server |
| 83 | - github.com/golang-jwt/jwt/v5\.RegisteredClaims |
| 84 | |
| 85 | funlen: |
| 86 | lines: 100 |
| 87 | statements: 50 |
| 88 | ignore-comments: true |
| 89 | |
| 90 | gocritic: |
| 91 | settings: |
| 92 | captLocal: |
| 93 | paramsOnly: false |
| 94 | underef: |
| 95 | skipRecvDeref: false |
| 96 | |
| 97 | govet: |
| 98 | disable: |
| 99 | - fieldalignment |
| 100 | enable-all: true |
| 101 | |
| 102 | exclusions: |
| 103 | generated: lax |
| 104 | presets: |
| 105 | - comments |
| 106 | - common-false-positives |
| 107 | - legacy |
| 108 | - std-error-handling |
| 109 | rules: |
| 110 | - linters: |
| 111 | - gocritic |
| 112 | source: //noinspection |
| 113 | - linters: |
| 114 | - bodyclose |
| 115 | - dupl |
| 116 | - err113 |
| 117 | - funlen |
| 118 | - goconst |
| 119 | - gosec |
| 120 | - lll |
| 121 | - noctx |
| 122 | - wrapcheck |
| 123 | path: _test\.go |
| 124 | paths: |
| 125 | - third_party$ |
| 126 | - builtin$ |
| 127 | - examples$ |
| 128 | |
| 129 | issues: |
| 130 | max-same-issues: 50 |
| 131 | |
| 132 | formatters: |
| 133 | enable: |
| 134 | - gofumpt |
| 135 | - goimports |
| 136 | exclusions: |
| 137 | generated: lax |
| 138 | paths: |
| 139 | - third_party$ |
| 140 | - builtin$ |
| 141 | - examples$ |