From d212e84fb6dbec5c6c9de70b6cb32d7112bdf2da Mon Sep 17 00:00:00 2001 From: glyphack <glyphack@pop-os.localdomain> Date: Fri, 2 Oct 2020 13:27:19 +0330 Subject: [PATCH 1/8] .github/workflows: add golangci lint GH action use https://github.com/marketplace/actions/run-golangci-lint to lint code for new changes on PRs. Fixes #2972 Signed-off-by: Shayegan Hooshyari <sh.hooshyari@gmail.com> --- .github/workflows/golangci-lint.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/golangci-lint.yaml diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml new file mode 100644 index 00000000000..7e282e980fd --- /dev/null +++ b/.github/workflows/golangci-lint.yaml @@ -0,0 +1,14 @@ +name: golangci-lint +on: + pull_request: +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.29 + # only-new-issues: true From 6215db6dfafdaf18d4d5ee06e06ef94bb44823b7 Mon Sep 17 00:00:00 2001 From: Shayegan Hooshyari <sh.hooshyari@gmail.com> Date: Sat, 3 Oct 2020 11:38:02 +0200 Subject: [PATCH 2/8] set golangci action to only check new issues Updates: #2976 Signed-off-by: Shayegan Hooshyari <sh.hooshyari@gmail.com> --- .github/workflows/golangci-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 7e282e980fd..511ec121023 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -11,4 +11,4 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.29 - # only-new-issues: true + only-new-issues: true From af97c6a05b80e9bd912ca3da95fc169c75c356fc Mon Sep 17 00:00:00 2001 From: Shayegan Hooshyari <sh.hooshyari@gmail.com> Date: Sat, 3 Oct 2020 11:39:25 +0200 Subject: [PATCH 3/8] Add a unused function to test golangci-lint Updates: #2976 Signed-off-by: Shayegan Hooshyari <sh.hooshyari@gmail.com> --- internal/contour/handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/contour/handler.go b/internal/contour/handler.go index c699187c50c..4876fd6307c 100644 --- a/internal/contour/handler.go +++ b/internal/contour/handler.go @@ -216,3 +216,7 @@ func (e *EventHandler) rebuildDAG() { } } + +func unUsedFunc() interface{} { + return nil +} From 46abedce6398a4fe79b4ee128a48fe80d5fccba6 Mon Sep 17 00:00:00 2001 From: glyphack <sh.hooshyari@gmail.com> Date: Tue, 6 Oct 2020 21:18:29 +0330 Subject: [PATCH 4/8] Remove lint step from prbuild action Updates: #2976 Signed-off-by: glyphack <sh.hooshyari@gmail.com> --- .github/workflows/prbuild.yaml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/prbuild.yaml b/.github/workflows/prbuild.yaml index 3a887fe2149..06dda092bb0 100644 --- a/.github/workflows/prbuild.yaml +++ b/.github/workflows/prbuild.yaml @@ -45,17 +45,6 @@ jobs: go mod vendor make install make check-coverage - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: '1.15.2' - - name: lint - run: | - go mod vendor - make lint codegen: runs-on: ubuntu-latest steps: From b281e63b886dec57219076634fb0ed9e781abc83 Mon Sep 17 00:00:00 2001 From: glyphack <sh.hooshyari@gmail.com> Date: Tue, 6 Oct 2020 21:19:01 +0330 Subject: [PATCH 5/8] Bump golangci-lint version to v1.31.0 Updates: #2976 Signed-off-by: glyphack <sh.hooshyari@gmail.com> --- .github/workflows/golangci-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 511ec121023..94d44d2fd5e 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -10,5 +10,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.29 + version: v1.31.0 only-new-issues: true From bb3ce4fc04cd6e79235acddfeaed44b1bd1c1ab3 Mon Sep 17 00:00:00 2001 From: glyphack <sh.hooshyari@gmail.com> Date: Tue, 6 Oct 2020 21:19:38 +0330 Subject: [PATCH 6/8] Revert test golangci-lint Updates: #2976 Signed-off-by: glyphack <sh.hooshyari@gmail.com> --- internal/contour/handler.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/contour/handler.go b/internal/contour/handler.go index 4876fd6307c..c699187c50c 100644 --- a/internal/contour/handler.go +++ b/internal/contour/handler.go @@ -216,7 +216,3 @@ func (e *EventHandler) rebuildDAG() { } } - -func unUsedFunc() interface{} { - return nil -} From 58531531fb19067c6099f956956b8a824127e720 Mon Sep 17 00:00:00 2001 From: glyphack <sh.hooshyari@gmail.com> Date: Tue, 6 Oct 2020 21:45:09 +0330 Subject: [PATCH 7/8] Fix only can set minor version for golangci-lint Updates: #2976 Signed-off-by: glyphack <sh.hooshyari@gmail.com> --- .github/workflows/golangci-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 94d44d2fd5e..bc0ab68cba4 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -10,5 +10,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.31.0 + version: v1.31 only-new-issues: true From 971b2f400fa7f6d523bb77e8fbfad78fa4629184 Mon Sep 17 00:00:00 2001 From: glyphack <sh.hooshyari@gmail.com> Date: Wed, 21 Oct 2020 10:25:11 +0330 Subject: [PATCH 8/8] Move lint action info prbuilb.yml Updates: #2976 Signed-off-by: glyphack <sh.hooshyari@gmail.com> --- .github/workflows/golangci-lint.yaml | 14 -------------- .github/workflows/prbuild.yaml | 9 +++++++++ 2 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 .github/workflows/golangci-lint.yaml diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml deleted file mode 100644 index bc0ab68cba4..00000000000 --- a/.github/workflows/golangci-lint.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: golangci-lint -on: - pull_request: -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: v1.31 - only-new-issues: true diff --git a/.github/workflows/prbuild.yaml b/.github/workflows/prbuild.yaml index 06dda092bb0..f485e2c369e 100644 --- a/.github/workflows/prbuild.yaml +++ b/.github/workflows/prbuild.yaml @@ -45,6 +45,15 @@ jobs: go mod vendor make install make check-coverage + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.31 + only-new-issues: true codegen: runs-on: ubuntu-latest steps: