Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: added golangci-lint to pre-commit #829

Merged
merged 9 commits into from
Dec 20, 2024
21 changes: 5 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
with:
python-version: 3.x

- uses: actions/cache@v4
with:
path: ~/.cache/golangci-lint
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
lukasmetzner marked this conversation as resolved.
Show resolved Hide resolved

- uses: pre-commit/action@v3.0.1

test:
Expand All @@ -36,22 +41,6 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- uses: golangci/golangci-lint-action@v6
with:
version: v1.62.2 # renovate: datasource=github-releases depName=golangci/golangci-lint

# In general linting is quite fast with warm caches, but a fresh run might take some time.
args: --timeout 5m

deploy-manifests:
name: Check deployment manifests
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ repos:
files: \.(md|ya?ml)$
exclude: ^(CHANGELOG.md|chart/templates/.*|chart/.snapshots/.*)$

- repo: https://github.com/golangci/golangci-lint
rev: v1.62.2
hooks:
- id: golangci-lint-full
args: [--timeout=5m]
language_version: 1.23.4 # renovate: datasource=golang-version

- repo: local
hooks:
- id: shfmt
Expand Down
Loading