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
4 changes: 2 additions & 2 deletions .github/internal/plans/MASTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Each item links to its detailed implementation plan.
| S1 | Commit Validation | 🟢 | [sdlc/01-commit-validation.md](sdlc/01-commit-validation.md) | Lefthook + Go commitlint |
| S2 | Changelog Automation | ⏭️ | — | Auto-generate CHANGELOG.md from commits |
| S3 | Release Workflow | ⏭️ | — | GitHub Actions with goreleaser |
| S4 | Pre-commit Hooks | ⏭️ | — | Run fmt/lint before commit |
| S5 | Test Coverage | ⏭️ | — | Coverage reporting in CI |
| S4 | Pre-commit Hooks | 🟢 | — | Run fmt/lint before commit |
| S5 | Test Coverage | 🟢 | — | Coverage reporting in CI |

---

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
pull_request:

jobs:
pr-title:
name: Validate PR Title
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

lint:
runs-on: ubuntu-latest
steps:
Expand Down
25 changes: 25 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# Lefthook configuration for git hooks
# Setup: make setup-hooks

pre-commit:
parallel: true
commands:
gofmt:
glob: "*.go"
run: |
if [ -z "{staged_files}" ]; then exit 0; fi
unformatted="$(gofmt -l {staged_files})" || exit $?
test -z "$unformatted"
fail_text: "Files need formatting. Run 'make fmt'"

goimports:
glob: "*.go"
run: |
if [ -z "{staged_files}" ]; then exit 0; fi
unformatted="$(goimports -l {staged_files})" || exit $?
test -z "$unformatted"
fail_text: "Imports need formatting. Run 'make fmt'"

golangci-lint:
glob: "*.go"
run: |
if [ -z "{staged_files}" ]; then exit 0; fi
golangci-lint run {staged_files}

commit-msg:
commands:
commitlint:
Expand Down
Loading