diff --git a/.github/workflows/scan-lint.yml b/.github/workflows/scan-lint.yml new file mode 100644 index 0000000..36b0f15 --- /dev/null +++ b/.github/workflows/scan-lint.yml @@ -0,0 +1,19 @@ +name: Validate Lint +on: pull_request + +permissions: + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + + - name: Run Revive Action by pulling pre-built image + uses: docker://morphy/revive-action:v2 + with: + config: revive.toml + # Path pattern (default: ./...) + path: "./credential-helper/..." diff --git a/revive.toml b/revive.toml new file mode 100644 index 0000000..ebda8f5 --- /dev/null +++ b/revive.toml @@ -0,0 +1,31 @@ +ignoreGeneratedHeader = false +severity = "warning" +confidence = 0.8 +errorCode = 0 +warningCode = 0 +formatter = "stylish" + +[rule.blank-imports] +[rule.context-as-argument] +[rule.context-keys-type] +[rule.dot-imports] +[rule.error-return] +[rule.error-strings] +[rule.error-naming] +[rule.exported] +[rule.if-return] +[rule.increment-decrement] +[rule.var-naming] +[rule.var-declaration] +[rule.package-comments] +[rule.range] +[rule.receiver-naming] +[rule.time-naming] +[rule.unexported-return] +[rule.indent-error-flow] +[rule.errorf] +[rule.empty-block] +[rule.superfluous-else] +[rule.unused-parameter] +[rule.unreachable-code] +[rule.redefines-builtin-id]