From e120d891af036e6bb44e177b3546e4baa5ee3813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20B=C3=A4ckevik?= Date: Mon, 29 Jun 2026 13:08:13 +0200 Subject: [PATCH] chore: align tooling and dependency management Three changes: 1. Dependabot: add .github/dependabot.yml with weekly, grouped version updates for the Go module ('fix' prefix so bumps flow through the semantic release) and GitHub Actions ('ci' prefix). 2. Go 1.24 -> 1.26: update the mise tool pin and go.mod language version. 3. Conventional Commits enforced via commitlint: add .commitlintrc.yaml, a 'lint:commits' mise task wired into the build, and fetch-depth: 0 on the CI/release checkouts so commitlint can range over commits. Verified locally on go1.26.4: build, lint, tests pass; commitlint rejects non-conventional messages and accepts conventional ones. --- .commitlintrc.yaml | 16 ++++++++++++++++ .github/dependabot.yml | 24 ++++++++++++++++++++++++ .github/workflows/ci.yml | 3 +++ .github/workflows/release.yaml | 4 ++++ go.mod | 2 +- mise.toml | 20 ++++++++++++++++++-- 6 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 .commitlintrc.yaml create mode 100644 .github/dependabot.yml diff --git a/.commitlintrc.yaml b/.commitlintrc.yaml new file mode 100644 index 0000000..3b75306 --- /dev/null +++ b/.commitlintrc.yaml @@ -0,0 +1,16 @@ +rules: + type-enum: + - 2 + - always + - - feat + - fix + - refactor + - chore + - docs + - test + - perf + - ci + type-empty: [2, never] + subject-empty: [2, never] + subject-case: [2, never, sentence-case] + header-max-length: [2, always, 60] diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7bca0bd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: / + schedule: + interval: weekly + commit-message: + prefix: fix + prefix-development: chore + groups: + go-dependencies: + patterns: + - "*" + + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + commit-message: + prefix: ci + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ecbbce..79e0e21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Full history so commitlint can range over the PR's commits. + fetch-depth: 0 - name: Install mise uses: jdx/mise-action@v2 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9b66220..2154063 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # Full history + tags so commitlint and semantic-release can range + # over commits since the last release. + fetch-depth: 0 - name: Install mise uses: jdx/mise-action@v2 diff --git a/go.mod b/go.mod index 47907e1..beb8277 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/way-platform/mapbox-go -go 1.24 +go 1.26 require github.com/spf13/cobra v1.9.1 diff --git a/mise.toml b/mise.toml index 4d16c11..93b0bc2 100644 --- a/mise.toml +++ b/mise.toml @@ -8,17 +8,33 @@ # mise run cli # Build mapbox CLI binary [tools] -go = "1.24" +go = "1.26" golangci-lint = "2.10" +"npm:@commitlint/cli" = "21" [tasks.build] description = "run full CI build" -run = "mise run lint && mise run test && mise run tidy && mise run cli && mise run diff" +run = "mise run lint:commits && mise run lint && mise run test && mise run tidy && mise run cli && mise run diff" [tasks.lint] description = "lint Go code" run = "golangci-lint run --fix" +[tasks."lint:commits"] +description = "lint commit messages (conventional commits)" +run = """ +#!/usr/bin/env bash +set -euo pipefail +if [ -n "${GITHUB_BASE_REF:-}" ]; then + git fetch origin "$GITHUB_BASE_REF" 2>/dev/null || true + commitlint --from "origin/$GITHUB_BASE_REF" --to HEAD +elif [ -n "$(git tag -l)" ]; then + commitlint --from "$(git describe --tags --abbrev=0)" --to HEAD +else + commitlint --last +fi +""" + [tasks.test] description = "run Go tests" run = "go test -count=1 -cover ./..."