diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..e2c3a5c --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,100 @@ +run: + tests: false + skip-dirs: + - tests/e2e + - tests/simulation + + govet: + # Enable analyzers by name (in addition to default). + # Run `go tool vet help` to see all analyzers. + # Default: [] + enable: + - fieldalignment + +linters: + enable: + # - dupl + # - nestif + # - rowserrcheck -- enable when it will support generics + # - whitespace + # - wsl + - asciicheck + - bodyclose + # TODO; we need re-enable this linter once golangci-lint or .depguard.yaml is done + # - depguard + - dogsled + - errcheck + - exportloopref + - goconst + - gocritic + - gofmt + - goimports + - gosec + - gosimple + - govet + - grouper + - ineffassign + - lll + - misspell + - nakedret + - nolintlint + - prealloc + - revive + - staticcheck + - stylecheck + - typecheck + - unconvert + - unparam + - unused + - usestdlibvars + +issues: + exclude-rules: + - path: _test\.go + linters: + - gosec + - linters: + - lll + source: "https://" + max-same-issues: 50 + +linters-settings: + dogsled: + max-blank-identifiers: 3 + misspell: + locale: US + nolintlint: + allow-unused: false + allow-leading-space: true + require-explanation: false + revive: + confidence: 0 + severity: error + error-code: 1 + warning-code: 0 + # List of rules to enable explicitly should be a subset of .revive.toml + # so only critical rules cause CI to fail instead of just generating annotations. + rules: + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: empty-block + - name: error-return + - name: error-strings + - name: error-naming + - name: errorf + - name: exported + - name: if-return + - name: increment-decrement + - name: indent-error-flow + - name: range + - name: receiver-naming + # - name: redefines-builtin-id + - name: superfluous-else + - name: time-naming + - name: unexported-return + - name: unreachable-code + # - name: unused-parameter + - name: var-declaration + - name: var-naming diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000..2f42fc2 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,5 @@ +# Default state for all rules +default: true +# MD014/commands-show-output Dollar signs used before commands without showing output +MD014: false +MD013: false diff --git a/.revive.toml b/.revive.toml new file mode 100644 index 0000000..0b071d0 --- /dev/null +++ b/.revive.toml @@ -0,0 +1,66 @@ +# Sets the default severity to "error" +severity = "error" + +# Sets the default failure confidence. This means that linting errors +# with less than 0 confidence will be ignored. +confidence = 0 + +# https://github.com/mgechev/revive#configuration + +# Recommended configuration, minus what's commented out +[rule.blank-imports] +[rule.context-as-argument] +[rule.context-keys-type] +[rule.dot-imports] +[rule.empty-block] +[rule.error-return] +[rule.error-strings] +[rule.error-naming] +[rule.errorf] +#[rule.exported] +[rule.if-return] +[rule.increment-decrement] +[rule.indent-error-flow] +#[rule.package-comments] +[rule.range] +[rule.receiver-naming] +#[rule.redefines-builtin-id] +[rule.superfluous-else] +[rule.time-naming] +[rule.unexported-return] +[rule.unreachable-code] +#[rule.unused-parameter] +[rule.var-declaration] +[rule.var-naming] + +# Additional rules +[rule.atomic] +[rule.bool-literal-in-expr] +[rule.constant-logical-expr] +[rule.datarace] +[rule.duplicated-imports] +[rule.early-return] +#[rule.empty-lines] +[rule.get-return] +[rule.identical-branches] +[rule.modifies-value-receiver] +#[rule.optimize-operands-order] +[rule.range-val-address] +[rule.range-val-in-closure] +[rule.string-of-int] +[rule.struct-tag] +[rule.time-equal] +[rule.unconditional-recursion] +#[rule.unexported-naming] +#[rule.unhandled-error] +[rule.unnecessary-stmt] +#[rule.unused-receiver] +#[rule.use-any] +#[rule.useless-break] +[rule.waitgroup-by-value] + +# Rules that we might want to enable +#[rule.bare-return] +#[rule.deep-exit] +#[rule.defer] +#[rule.import-shadowing]