-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cicd): adding additional linters (#41)
adding additional linters
- Loading branch information
1 parent
adfa8fc
commit d17384f
Showing
7 changed files
with
166 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
linters: | ||
enable: | ||
- revive | ||
- sloglint | ||
- godox | ||
- gosec | ||
- musttag | ||
- nilnil | ||
- goconst | ||
- gocritic | ||
- gofmt | ||
- iface | ||
- thelper | ||
- tparallel | ||
linters-settings: | ||
revive: | ||
# Default: false | ||
ignore-generated-header: true | ||
# Default: 0.8 | ||
confidence: 0.1 | ||
rules: | ||
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#context-as-argument | ||
- name: context-as-argument | ||
severity: error | ||
disabled: false | ||
exclude: [ "" ] | ||
arguments: | ||
- allowTypesBefore: "*testing.T" | ||
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#early-return | ||
- name: early-return | ||
severity: error | ||
disabled: false | ||
exclude: [ "" ] | ||
arguments: | ||
- "preserveScope" | ||
- "allowJump" | ||
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-map-style | ||
- name: enforce-map-style | ||
severity: error | ||
disabled: false | ||
exclude: [ "" ] | ||
arguments: | ||
- "make" | ||
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-slice-style | ||
- name: enforce-slice-style | ||
severity: error | ||
disabled: false | ||
exclude: [ "" ] | ||
arguments: | ||
- "make" | ||
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#filename-format | ||
- name: filename-format | ||
severity: error | ||
disabled: false | ||
exclude: [ "" ] | ||
arguments: | ||
- "^[_a-z][_a-z0-9]*.go$" | ||
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#optimize-operands-order | ||
- name: optimize-operands-order | ||
severity: error | ||
disabled: false | ||
exclude: [ "" ] | ||
sloglint: | ||
# Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only). | ||
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#attributes-only | ||
# Default: false | ||
attr-only: true | ||
# Enforce using static values for log messages. | ||
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#static-messages | ||
# Default: false | ||
static-msg: true | ||
# Enforce using constants instead of raw keys. | ||
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-raw-keys | ||
# Default: false | ||
no-raw-keys: true | ||
# Enforce a single key naming convention. | ||
# Values: snake, kebab, camel, pascal | ||
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-naming-convention | ||
# Default: "" | ||
key-naming-case: snake | ||
# Enforce not using specific keys. | ||
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#forbidden-keys | ||
# Default: [] | ||
forbidden-keys: | ||
- time | ||
- level | ||
- msg | ||
- source | ||
- foo | ||
# Enforce putting arguments on separate lines. | ||
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#arguments-on-separate-lines | ||
# Default: false | ||
args-on-sep-lines: true | ||
goconst: | ||
# Ignore test files. | ||
# Default: false | ||
ignore-tests: true | ||
# Ignore when constant is not used as function argument. | ||
# Default: true | ||
ignore-calls: true | ||
# Exclude strings matching the given regular expression. | ||
# Default: "" | ||
ignore-strings: '' | ||
nilnil: | ||
# In addition, detect opposite situation (simultaneous return of non-nil error and valid value). | ||
# Default: false | ||
detect-opposite: true | ||
# List of return types to check. | ||
# Default: ["chan", "func", "iface", "map", "ptr", "uintptr", "unsafeptr"] | ||
checked-types: | ||
- chan | ||
- func | ||
- iface | ||
- map | ||
- ptr | ||
- uintptr | ||
- unsafeptr | ||
gocritic: | ||
enable-all: true | ||
gofmt: | ||
# Simplify code: gofmt with `-s` option. | ||
# Default: true | ||
simplify: false | ||
# Apply the rewrite rules to the source before reformatting. | ||
# https://pkg.go.dev/cmd/gofmt | ||
# Default: [] | ||
rewrite-rules: | ||
- pattern: 'interface{}' | ||
replacement: 'any' | ||
- pattern: 'a[b:len(a)]' | ||
replacement: 'a[b:]' | ||
iface: | ||
# List of analyzers. | ||
# Default: ["identical"] | ||
enable: | ||
- identical # Identifies interfaces in the same package that have identical method sets. | ||
- unused # Identifies interfaces that are not used anywhere in the same package where the interface is defined. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
package vaulty | ||
|
||
const ( | ||
loggingKeyError = "err" | ||
loggingKeyError = "err" | ||
loggingKeySecretName = "secret" | ||
|
||
pathKeyTransitDecrypt = "decrypt" | ||
pathKeyTransitEncrypt = "encrypt" | ||
|
||
TransitKeyCipherText = "ciphertext" | ||
TransitKeyPlainText = "plaintext" | ||
|
||
envKubernetesRole = "KUBERNETES_ROLE" | ||
envKubernetesToken = "KUBERNETES_TOKEN" | ||
envKubernetesRole = "KUBERNETES_ROLE" // nolint:gosec // This is detected as a secret | ||
envKubernetesToken = "KUBERNETES_TOKEN" // nolint:gosec // This is detected as a secret | ||
|
||
kubernetesServiceAccountTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token" | ||
// KubernetesServiceAccountTokenPath is the path to the Kubernetes service account token. | ||
kubernetesServiceAccountTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token" // nolint:gosec // This is detected as a secret | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters