Skip to content

Commit ee0c491

Browse files
authored
Fix pre-commit and action linter (#1172)
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.
1 parent 66fbaa7 commit ee0c491

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

.github/workflows/lint.yml

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
3737
with:
3838
args: --timeout 10m0s
39-
only-new-issues: true
4039

4140
njs-lint:
4241
name: NJS Lint

.golangci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ linters-settings:
99
- name: blank-imports
1010
- name: context-as-argument
1111
- name: context-keys-type
12-
- name: dot-imports
1312
- name: empty-block
1413
- name: error-naming
1514
- name: error-return

.pre-commit-config.yaml

+3-13
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,10 @@ repos:
3434
types:
3535
- javascript
3636

37-
- repo: local
38-
hooks:
39-
- id: golang-diff
40-
name: create-go-diff
41-
entry: bash -c 'git diff -p origin/main > /tmp/diff.patch'
42-
language: system
43-
types: [go]
44-
pass_filenames: false
45-
4637
- repo: https://github.com/golangci/golangci-lint
47-
rev: v1.54.2
38+
rev: v1.55.0
4839
hooks:
49-
- id: golangci-lint
50-
args: [--new-from-patch=/tmp/diff.patch]
40+
- id: golangci-lint-full
5141

5242
# Rules are in .markdownlint-cli2.yaml file
5343
# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for rule descriptions
@@ -64,5 +54,5 @@ repos:
6454
- id: yamllint
6555

6656
ci:
67-
skip: [golang-diff, golangci-lint, prettier, markdownlint-cli2-fix, yamllint]
57+
skip: [golangci-lint-full, prettier, markdownlint-cli2-fix, yamllint]
6858
autofix_prs: false

0 commit comments

Comments
 (0)