From ec2846b1cc68fad91b046bc4458e6f630947297c Mon Sep 17 00:00:00 2001 From: Soule BA Date: Thu, 9 Sep 2021 18:32:28 +0200 Subject: [PATCH] adding a linter Signed-off-by: Soule BA --- .github/workflows/lint.yaml | 27 +++++++++++++++++++++++++++ revive/config.toml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/lint.yaml create mode 100644 revive/config.toml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..73d5ec61 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,27 @@ +name: lint + +on: + workflow_dispatch: + push: + branches-ignore: + # Do not push events to branches matching refs/heads/main + - 'main' + tags-ignore: [ '*' ] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v2 + + - name: Run Revive Action + uses: docker://morphy/revive-action:v2 + with: + # Path to your Revive config within the repo (optional) + config: revive/config.toml + + + diff --git a/revive/config.toml b/revive/config.toml new file mode 100644 index 00000000..6e994d3b --- /dev/null +++ b/revive/config.toml @@ -0,0 +1,34 @@ +ignoreGeneratedHeader = false +severity = "warning" +confidence = 0.8 +errorCode = 0 +warningCode = 0 + +[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.function-length] + arguments = [40,60] +[rule.function-result-limit] + arguments = [3] +[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]