Skip to content

Commit ca5af59

Browse files
committed
```
feat: Add editor command support ``` **Explanation:** This commit message follows the Conventional Commits format (`feat: Add X`) and reflects the addition of an editor command functionality in the `OpenInEditor` function. The message clearly indicates the feature being introduced and its purpose.
1 parent c3328a9 commit ca5af59

13 files changed

Lines changed: 753 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
name: Test
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.26'
23+
24+
- name: Go mod tidy
25+
run: go mod tidy
26+
27+
- name: Go mod verify
28+
run: go mod verify
29+
30+
- name: Run tests
31+
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
32+
33+
- name: Upload coverage
34+
uses: codecov/codecov-action@v4
35+
with:
36+
files: ./coverage.txt
37+
fail_ci_if_error: false
38+
39+
build:
40+
name: Build
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Set up Go
47+
uses: actions/setup-go@v5
48+
with:
49+
go-version: '1.26'
50+
51+
- name: Build
52+
run: go build -v .
53+
54+
lint:
55+
name: Lint
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
61+
- name: Set up Go
62+
uses: actions/setup-go@v5
63+
with:
64+
go-version: '1.26'
65+
66+
- name: golangci-lint
67+
uses: golangci/golangci-lint-action@v7
68+
with:
69+
version: v2.5.0
70+
71+
constitution:
72+
name: Constitution Audit
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v4
77+
78+
- name: Run constitution audit
79+
run: |
80+
chmod +x scripts/audit-constitution.sh
81+
./scripts/audit-constitution.sh
82+
continue-on-error: true
83+
84+
- name: Enforce constitution (fail on violations)
85+
run: |
86+
if ./scripts/audit-constitution.sh; then
87+
echo "✅ All packages comply with the constitution"
88+
exit 0
89+
else
90+
echo "❌ Constitution violations detected — see output above"
91+
echo " Principle II: cmd/*.go Run() must not import cobra"
92+
echo " Principle VII: internal/ui must not import internal/*"
93+
echo " Principle VII: internal/llm must not import internal/config or internal/secret"
94+
echo " Principle VII: internal/hook must not call exec.Command directly"
95+
echo " Paths: no package outside internal/dirs may call os.UserConfigDir()"
96+
exit 1
97+
fi

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
goreleaser:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.26'
25+
26+
- name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v6
28+
with:
29+
distribution: goreleaser
30+
version: '~> v2'
31+
args: release --clean
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}

.golangci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# golangci-lint configuration (v2)
2+
version: "2"
3+
4+
run:
5+
timeout: 5m
6+
go: "1.26"
7+
tests: false
8+
9+
linters:
10+
enable:
11+
- govet
12+
- staticcheck
13+
- errcheck
14+
- ineffassign
15+
- unused
16+
- misspell
17+
disable:
18+
- exhaustive
19+
- exhaustruct
20+
- varnamelen
21+
- revive
22+
23+
formatters:
24+
enable:
25+
- gofmt

.goreleaser.yaml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# GoReleaser configuration for git-msg
2+
# https://goreleaser.com
3+
4+
version: 2
5+
6+
project_name: git-msg
7+
8+
env:
9+
- GO111MODULE=on
10+
11+
git:
12+
tag_sort: -version:refname
13+
14+
before:
15+
hooks:
16+
- go mod tidy
17+
18+
builds:
19+
- id: git-msg
20+
binary: git-msg
21+
main: .
22+
# v1: macOS and Linux only — Windows excluded (keychain non-goal, see constitution §VI)
23+
goos:
24+
- linux
25+
- darwin
26+
goarch:
27+
- amd64
28+
- arm64
29+
flags:
30+
- -trimpath
31+
ldflags:
32+
- -s -w
33+
- -X main.Version={{.Version}}
34+
- -X main.commit={{.Commit}}
35+
- -X main.date={{.Date}}
36+
- -X main.builtBy=goreleaser
37+
env:
38+
- CGO_ENABLED=0
39+
40+
# Universal binary for macOS (amd64 + arm64 combined)
41+
universal_binaries:
42+
- id: git-msg_universal
43+
replace: true
44+
name_template: git-msg
45+
46+
archives:
47+
- id: default
48+
formats: [tar.gz]
49+
name_template: >-
50+
{{ .ProjectName }}_
51+
{{- title .Os }}_
52+
{{- if eq .Arch "amd64" }}x86_64
53+
{{- else if eq .Arch "386" }}i386
54+
{{- else }}{{ .Arch }}{{ end }}
55+
{{- if .Arm }}v{{ .Arm }}{{ end }}
56+
files:
57+
- README.md
58+
- LICENSE*
59+
- CHANGELOG*
60+
61+
checksum:
62+
name_template: checksums.txt
63+
algorithm: sha256
64+
65+
snapshot:
66+
version_template: "{{ incpatch .Version }}-next"
67+
68+
changelog:
69+
sort: asc
70+
use: github
71+
filters:
72+
exclude:
73+
- "^docs:"
74+
- "^test:"
75+
- "^ci:"
76+
- "^chore:"
77+
- "^style:"
78+
- "merge conflict"
79+
- Merge pull request
80+
- Merge remote-tracking branch
81+
- Merge branch
82+
groups:
83+
- title: "New Features"
84+
regexp: "^.*feat[(\\w)]*:+.*$"
85+
order: 0
86+
- title: "Bug Fixes"
87+
regexp: "^.*fix[(\\w)]*:+.*$"
88+
order: 1
89+
- title: "Enhancements"
90+
regexp: "^.*enhance[(\\w)]*:+.*$"
91+
order: 2
92+
- title: "Performance Improvements"
93+
regexp: "^.*perf[(\\w)]*:+.*$"
94+
order: 3
95+
- title: "Refactoring"
96+
regexp: "^.*refactor[(\\w)]*:+.*$"
97+
order: 4
98+
- title: "Other"
99+
order: 999
100+
101+
release:
102+
github:
103+
owner: madstone-tech
104+
name: git-msg
105+
draft: false
106+
prerelease: auto
107+
mode: replace
108+
header: |
109+
## git-msg {{ .Tag }}
110+
111+
AI-assisted git commit message generator with multi-provider LLM support.
112+
113+
### Installation
114+
115+
```bash
116+
# Download the binary for your platform from the assets below
117+
tar -xzf git-msg_*.tar.gz
118+
sudo mv git-msg /usr/local/bin/
119+
120+
# Or using Go
121+
go install github.com/madstone0-0/git-msg@{{ .Tag }}
122+
123+
# Or using Homebrew
124+
brew tap madstone-tech/tap
125+
brew install git-msg
126+
```
127+
128+
### First run
129+
130+
```bash
131+
git-msg generate --dry-run
132+
```
133+
134+
Config is stored at `~/.config/mdstn/git-msg/config.toml`.
135+
136+
footer: |
137+
**Full Changelog**: https://github.com/madstone-tech/git-msg/compare/{{ .PreviousTag }}...{{ .Tag }}
138+
139+
**Checksums**: {{ .Tag }}/checksums.txt
140+
141+
homebrew_casks:
142+
- repository:
143+
owner: madstone-tech
144+
name: homebrew-tap
145+
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
146+
directory: Casks
147+
homepage: "https://github.com/madstone-tech/git-msg"
148+
description: "AI-assisted git commit message generator with multi-provider LLM support"
149+
license: "MIT"
150+
url:
151+
verified: "github.com/madstone-tech/git-msg"
152+
hooks:
153+
post:
154+
install: |
155+
if OS.mac?
156+
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/git-msg"]
157+
end
158+
159+
announce:
160+
skip: true

0 commit comments

Comments
 (0)