Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: CI

on:
push:
Expand All @@ -12,13 +12,13 @@ permissions:
pull-requests: read

jobs:
build:
test:
strategy:
fail-fast: false
matrix:
go: [stable, oldstable]
os: [macos-latest, windows-latest, ubuntu-latest]
name: build
name: test
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
Expand All @@ -30,14 +30,25 @@ jobs:
run: go build -v ./...
- name: Test
run: mise run test
check:
name: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version: stable
- uses: jdx/mise-action@v4
- name: pre-commit
run: prek run --all-files
coverage:
name: coverage
permissions:
contents: write
concurrency:
group: coverage
runs-on: ubuntu-latest
needs: [build]
needs: [test]
steps:
- name: Update coverage report
uses: ncruces/go-coverage-report@v0
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/golangci-lint.yml

This file was deleted.

15 changes: 7 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
ci:
skip: [golangci-lint-full, go-test]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/golangci/golangci-lint
rev: v2.12.2
hooks:
- id: golangci-lint-full
- repo: local
hooks:
- id: golangci-lint
name: golangci-lint
language: system
types_or: [go]
pass_filenames: false
entry: mise run lint
- id: go-test
name: go test ./...
language: golang
language: system
types_or: [go]
pass_filenames: false
entry: mise run test
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ also vendored into `golangci-lint` (since v1.58.0).

- Run tests: `mise run test` (`go test -race -v ./...`)
- Run a single test: `go test -race -run TestSuggestedFixes ./pkg/analyzer/`
- Lint (runs pre-commit, incl. golangci-lint + tests): `mise run lint`
- Lint (golangci-lint with autofix): `mise run lint`
- Run the full hook suite (file hooks + golangci-lint + tests): `prek run --all-files`
- Build the CLI: `go build ./cmd/fatcontext`
- Release: push a git tag (`git tag -a vX.Y.Z -m "vX.Y.Z" && git push --follow-tags`),
which triggers GoReleaser via GitHub Actions.
Expand Down
13 changes: 11 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
[env]
CGO_ENABLED = 1

[tasks.lint]
run = "pre-commit run --all-files"
[tools]
golangci-lint = "2.12.2"
goreleaser = "2"
prek = "latest"

[tasks.test]
run = "go test -race -v ./..."

[tasks.lint]
run = "golangci-lint run --fix"

# Test a release locally without pushing a tag.
[tasks.release-snapshot]
run = "goreleaser release --snapshot --clean"
Loading