From ac8a6a1e1808c06f1c30c8160b38aa70ffb05815 Mon Sep 17 00:00:00 2001 From: Lucas Rodriguez Date: Mon, 16 Oct 2023 15:41:09 -0500 Subject: [PATCH] Add revive lint workflow for Go CronJob --- .github/workflows/scan-lint.yml | 19 +++++++++++++++++++ revive.toml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/scan-lint.yml create mode 100644 revive.toml 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]