From 3460702065fb3b25acd2ff22953d03976226dcbd Mon Sep 17 00:00:00 2001 From: matzehuels Date: Mon, 15 Dec 2025 22:09:32 -0500 Subject: [PATCH 1/3] ci: add commitlint to enforce conventional commits --- .github/workflows/commitlint.yml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/commitlint.yml diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..196c094 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,38 @@ +name: Commitlint + +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check PR title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + # Conventional commit pattern: type(scope)?: description + pattern='^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)(\([a-z0-9-]+\))?: .+' + + if [[ ! "$PR_TITLE" =~ $pattern ]]; then + echo "❌ PR title does not follow conventional commits format" + echo "" + echo "Expected: : " + echo "Got: $PR_TITLE" + echo "" + echo "Valid types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert" + echo "" + echo "Examples:" + echo " feat: add new feature" + echo " fix: resolve memory leak" + echo " feat(parser): add ruby support" + exit 1 + fi + + echo "✅ PR title follows conventional commits: $PR_TITLE" + From be9837cbf24ec222f55f9caefceb77c05eca69ad Mon Sep 17 00:00:00 2001 From: matzehuels Date: Mon, 15 Dec 2025 22:21:38 -0500 Subject: [PATCH 2/3] ci: add dependabot, issue templates, PR template, and golangci-lint --- .github/ISSUE_TEMPLATE/bug_report.yml | 48 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 27 ++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 11 +++++ .github/dependabot.yml | 11 +++++ .github/workflows/ci.yml | 17 ++------ .golangci.yml | 26 ++++++++---- Makefile | 7 ++-- internal/cli/ordering.go | 1 + 8 files changed, 123 insertions(+), 25 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..276740c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,48 @@ +name: Bug Report +description: Report a bug or unexpected behavior +labels: [bug] +body: + - type: textarea + id: description + attributes: + label: Description + description: What happened? + placeholder: A clear description of the bug + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Steps to Reproduce + description: How can we reproduce this? + placeholder: | + 1. Run `stacktower parse ...` + 2. See error + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected Behavior + description: What did you expect to happen? + validations: + required: false + - type: input + id: version + attributes: + label: Version + description: Output of `stacktower --version` + placeholder: "v0.1.0" + validations: + required: true + - type: dropdown + id: os + attributes: + label: Operating System + options: + - macOS + - Linux + - Windows + validations: + required: true + diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..a7187c7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,27 @@ +name: Feature Request +description: Suggest an idea or improvement +labels: [enhancement] +body: + - type: textarea + id: description + attributes: + label: Description + description: What would you like to see? + placeholder: A clear description of the feature + validations: + required: true + - type: textarea + id: use-case + attributes: + label: Use Case + description: Why do you need this? What problem does it solve? + validations: + required: false + - type: textarea + id: alternatives + attributes: + label: Alternatives Considered + description: Have you considered any workarounds or alternatives? + validations: + required: false + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..9bb8b41 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +## Description + + + +## Checklist + +- [ ] Tests pass (`make test`) +- [ ] Code is formatted (`make fmt`) +- [ ] Lints pass (`make lint`) +- [ ] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..56b6002 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: / + schedule: + interval: weekly + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27dd672..4726013 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,23 +24,14 @@ jobs: go-version-file: 'go.mod' cache: true - - name: Format check - run: | - gofmt -s -l . | tee /tmp/gofmt.out - test ! -s /tmp/gofmt.out - - - name: Vet - run: go vet ./... + - name: Lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest - name: Test run: go test -race -timeout=2m ./... - - name: Staticcheck - uses: dominikh/staticcheck-action@v1 - with: - version: latest - install-go: false - - name: Vulncheck run: | go install golang.org/x/vuln/cmd/govulncheck@latest diff --git a/.golangci.yml b/.golangci.yml index 52ac06e..add9a1b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,17 +1,27 @@ version: "2" -run: - timeout: 5m - tests: false +formatters: + enable: + - gofmt + - goimports + settings: + goimports: + local-prefixes: + - github.com/matzehuels/stacktower linters: + default: none enable: - - errcheck - govet - staticcheck - unused - - ineffassign + - misspell + - unconvert -issues: - max-issues-per-linter: 0 - max-same-issues: 0 + settings: + staticcheck: + checks: + - all + - -ST1000 # package comments + - -ST1016 # receiver names + - -QF1003 # tagged switch suggestion diff --git a/Makefile b/Makefile index ff7cb46..d9b32ed 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,7 @@ fmt: @goimports -w -local stacktower . lint: - @go vet ./... - @staticcheck ./... + @golangci-lint run test: @go test -race -timeout=2m ./... @@ -48,7 +47,7 @@ blog-showcase: build @./scripts/blog_showcase.sh install-tools: - @go install honnef.co/go/tools/cmd/staticcheck@latest + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest @go install golang.org/x/tools/cmd/goimports@latest @go install golang.org/x/vuln/cmd/govulncheck@latest @@ -68,7 +67,7 @@ help: @echo "make - Run checks and build" @echo "make check - Format, lint, test" @echo "make fmt - Format code" - @echo "make lint - Run go vet and staticcheck" + @echo "make lint - Run golangci-lint" @echo "make test - Run tests" @echo "make cover - Run tests with coverage" @echo "make build - Build binary" diff --git a/internal/cli/ordering.go b/internal/cli/ordering.go index 8c08309..9eafe3e 100644 --- a/internal/cli/ordering.go +++ b/internal/cli/ordering.go @@ -6,6 +6,7 @@ import ( "time" "github.com/charmbracelet/log" + "github.com/matzehuels/stacktower/pkg/dag" "github.com/matzehuels/stacktower/pkg/render/tower/ordering" ) From bf0ddcdb254373fe56a86d5b916474388a7db7ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 03:22:29 +0000 Subject: [PATCH 3/3] chore(deps): bump github.com/goccy/go-graphviz from 0.2.9 to 0.2.10 Bumps [github.com/goccy/go-graphviz](https://github.com/goccy/go-graphviz) from 0.2.9 to 0.2.10. - [Release notes](https://github.com/goccy/go-graphviz/releases) - [Commits](https://github.com/goccy/go-graphviz/compare/v0.2.9...v0.2.10) --- updated-dependencies: - dependency-name: github.com/goccy/go-graphviz dependency-version: 0.2.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fd09b2e..7593f7a 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.24.11 require ( github.com/BurntSushi/toml v1.5.0 github.com/charmbracelet/log v0.4.2 - github.com/goccy/go-graphviz v0.2.9 + github.com/goccy/go-graphviz v0.2.10 github.com/spf13/cobra v1.10.1 ) diff --git a/go.sum b/go.sum index 26acffa..0057041 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/goccy/go-graphviz v0.2.9 h1:4yD2MIMpxNt+sOEARDh5jTE2S/jeAKi92w72B83mWGg= -github.com/goccy/go-graphviz v0.2.9/go.mod h1:hssjl/qbvUXGmloY81BwXt2nqoApKo7DFgDj5dLJGb8= +github.com/goccy/go-graphviz v0.2.10 h1:jHu/1I0Iw0xIzzYk96Ous/ZeuD11Rt2oW8juHdIE30g= +github.com/goccy/go-graphviz v0.2.10/go.mod h1:LRlMnNmY17QbN6fLnvOzY7g0rXQjLKAhzxeTHbEUM6w= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=