From b3b37f74b12c0349c67947435d7fee968c8cd2fe Mon Sep 17 00:00:00 2001 From: Saylor Berman Date: Fri, 20 Oct 2023 10:05:54 -0600 Subject: [PATCH 1/3] Fix pre-commit and action linter Problem: Linting errors were not being caught before being merged to main. Solution: Ensure that the pre commit hook runs on the full repo and not just the diff. Also disabled a the "only-new-issues" check in the pipeline to ensure everything is caught. --- .github/workflows/lint.yml | 1 - .golangci.yml | 1 - .pre-commit-config.yaml | 5 ++--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b92cffdd5..623834141 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,6 @@ jobs: uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 with: args: --timeout 10m0s - only-new-issues: true njs-lint: name: NJS Lint diff --git a/.golangci.yml b/.golangci.yml index fbdd3f462..1afc5317b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,7 +9,6 @@ linters-settings: - name: blank-imports - name: context-as-argument - name: context-keys-type - - name: dot-imports - name: empty-block - name: error-naming - name: error-return diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93427e930..0241f7825 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,10 +44,9 @@ repos: pass_filenames: false - repo: https://github.com/golangci/golangci-lint - rev: v1.54.2 + rev: v1.55.0 hooks: - - id: golangci-lint - args: [--new-from-patch=/tmp/diff.patch] + - id: golangci-lint-full # Rules are in .markdownlint-cli2.yaml file # See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for rule descriptions From 983b0809efc5aa3f65ab55b341d9ec6bbeefd3bf Mon Sep 17 00:00:00 2001 From: Saylor Berman Date: Fri, 20 Oct 2023 10:18:09 -0600 Subject: [PATCH 2/3] Remove diff patch step --- .pre-commit-config.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0241f7825..ac54a83c2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,15 +34,6 @@ repos: types: - javascript - - repo: local - hooks: - - id: golang-diff - name: create-go-diff - entry: bash -c 'git diff -p origin/main > /tmp/diff.patch' - language: system - types: [go] - pass_filenames: false - - repo: https://github.com/golangci/golangci-lint rev: v1.55.0 hooks: From 982f2c674ffdaf92c2cc3055d979efefd379df14 Mon Sep 17 00:00:00 2001 From: Saylor Berman Date: Fri, 20 Oct 2023 10:41:16 -0600 Subject: [PATCH 3/3] Fix ci skip --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac54a83c2..f3e1e6148 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,5 +54,5 @@ repos: - id: yamllint ci: - skip: [golang-diff, golangci-lint, prettier, markdownlint-cli2-fix, yamllint] + skip: [golangci-lint-full, prettier, markdownlint-cli2-fix, yamllint] autofix_prs: false