From 521dbb69dc813969b532a1891f80086092bd771e Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sat, 17 Feb 2024 14:59:43 +0100 Subject: [PATCH 1/3] replace linter actions with nix to ensure consistent version Signed-off-by: Kristoffer Dalby --- .github/workflows/lint.yml | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 662a4cf4ee..873041a1be 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,17 +26,12 @@ jobs: integration_test/ config-example.yaml + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: golangci-lint if: steps.changed-files.outputs.any_changed == 'true' - uses: golangci/golangci-lint-action@v2 - with: - version: v1.51.2 - - # Only block PRs on new problems. - # If this is not enabled, we will end up having PRs - # blocked because new linters has appared and other - # parts of the code is affected. - only-new-issues: true + run: nix develop --command -- golangci-lint run . prettier-lint: runs-on: ubuntu-latest @@ -61,20 +56,20 @@ jobs: **/*.scss **/*.html + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Prettify code if: steps.changed-files.outputs.any_changed == 'true' - uses: creyD/prettier_action@v4.3 - with: - prettier_options: >- - --check **/*.{ts,js,md,yaml,yml,sass,css,scss,html} - only_changed: false - dry: true + run: nix develop --command -- prettier --check **/*.{ts,js,md,yaml,yml,sass,css,scss,html} proto-lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: bufbuild/buf-setup-action@v1.7.0 - - uses: bufbuild/buf-lint-action@v1 - with: - input: "proto" + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + + - name: Buf lint + run: nix develop --command -- buf lint proto From e86aab5b6e254a9b9e19af07edee3a3fb81c04c6 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sat, 17 Feb 2024 15:10:26 +0100 Subject: [PATCH 2/3] configure golang-ci-lint Signed-off-by: Kristoffer Dalby --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 873041a1be..7b6d0771ec 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,7 +31,7 @@ jobs: - name: golangci-lint if: steps.changed-files.outputs.any_changed == 'true' - run: nix develop --command -- golangci-lint run . + run: nix develop --command -- golangci-lint run --new-from-rev=${{github.event.pull_request.base.sha}} --out-format=github-actions . prettier-lint: runs-on: ubuntu-latest From 4887e818367400bb87b660dd2cb0b29a7ae9ceb7 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sat, 17 Feb 2024 15:12:58 +0100 Subject: [PATCH 3/3] configure prettier Signed-off-by: Kristoffer Dalby --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7b6d0771ec..ade5ffc050 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -61,7 +61,7 @@ jobs: - name: Prettify code if: steps.changed-files.outputs.any_changed == 'true' - run: nix develop --command -- prettier --check **/*.{ts,js,md,yaml,yml,sass,css,scss,html} + run: nix develop --command -- prettier --no-error-on-unmatched-pattern --ignore-unknown --check **/*.{ts,js,md,yaml,yml,sass,css,scss,html} proto-lint: runs-on: ubuntu-latest