Skip to content

Commit

Permalink
Run golangci-lint in pre-commit only for changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Nov 12, 2022
1 parent cddd297 commit 80b4945
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,3 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
only-new-issues: true

lint-python:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: isort/isort-action@v1.1.0
- uses: psf/black@stable
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,19 @@ repos:
- id: no-commit-to-branch
- id: requirements-txt-fixer
- id: fix-byte-order-marker
- 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.50.1
hooks:
- id: golangci-lint
args: [--new-from-patch=/tmp/diff.patch]
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
hooks:
Expand All @@ -53,3 +62,5 @@ repos:
files: deployments/helm-chart/values.yaml
types: [yaml]
args: ['--schemafile', 'deployments/helm-chart/values.schema.json']
ci:
skip: [golang-diff, golangci-lint]

0 comments on commit 80b4945

Please sign in to comment.