From 90330b29593265e49038216ff6ba0961b1684750 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Thu, 27 Jun 2024 09:25:14 +1000 Subject: [PATCH] chore: enable wrapcheck for new code This has been disabled because manually wrapping all errors is very tedious when iterating quickly, but it's come to the point where we need to do this in order to provide useful errors. Recent examples of this are https://github.com/TBD54566975/ftl/pull/1885 and https://github.com/TBD54566975/ftl/pull/1879. --- .github/workflows/ci.yml | 4 +++- .golangci.yml | 1 - Justfile | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3b8f75cb7..b2ffd1a6db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,12 +58,14 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Init Hermit uses: cashapp/activate-hermit@v1 - name: Build Cache uses: ./.github/actions/build-cache - name: golangci-lint - run: golangci-lint run --out-format github-actions ./... + run: golangci-lint run --new-from-rev="$(git merge-base origin/main HEAD)" --out-format github-actions ./... - name: go-check-sumtype shell: bash run: go-check-sumtype ./... 2>&1 | to-annotation diff --git a/.golangci.yml b/.golangci.yml index 0642ccd592..93bac24c44 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -57,7 +57,6 @@ linters: - interfacebloat - tagalign - nolintlint - - wrapcheck # We might want to re-enable this if we manually wrap all the existing errors with fmt.Errorf - protogetter linters-settings: diff --git a/Justfile b/Justfile index 49515627d2..70ae697691 100644 --- a/Justfile +++ b/Justfile @@ -139,7 +139,7 @@ lint-frontend: build-frontend # Lint the backend lint-backend: - @golangci-lint run ./... + @golangci-lint run --new-from-rev=$(git merge-base origin/main HEAD) ./... # Run live docs server docs: