Skip to content

Commit d2089b7

Browse files
committed
chore: update dependency versions
1 parent 48b0393 commit d2089b7

13 files changed

Lines changed: 1149 additions & 526 deletions

.devcontainer/dev.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/rockylinux:9
1+
FROM docker.io/almalinux:9
22

33
ARG UV
44
ARG USERNAME=devu

.devcontainer/devcontainer.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
2-
"customizations": {},
2+
"customizations": {
3+
"vscode": {
4+
"extensions": [
5+
"Continue.continue",
6+
"streetsidesoftware.code-spell-checker",
7+
"oderwat.indent-rainbow",
8+
"yzhang.markdown-all-in-one",
9+
"christian-kohler.path-intellisense",
10+
"Gruntfuggly.todo-tree",
11+
"aaron-bond.better-comments",
12+
"tamasfe.even-better-toml",
13+
"ms-python.python"
14+
]
15+
}
16+
},
317
"dockerComposeFile": [
418
"../dev.docker-compose.yml"
519
],

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
.ruff_cache/
66
.VSCodeCounter/
77
.uv
8+
.commit_msg
9+
.commit_msg.*
810

911
# https://github.com/github/gitignore
1012
# CC0 1.0 Universal

Makefile

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ include $(ROOT_MAKEFILE)/.env
1010

1111
export
1212
export PATH := $(PATH):$(shell pwd)/$(UV_INSTALL_DIR)
13+
OLLAMA_MODEL?=gpt-oss:20b
1314

1415
$(eval UVEL := $(shell which uv && echo "true" || echo ""))
1516
UVE = $(if ${UVEL},'uv',$(UV_INSTALL_DIR)/uv)
@@ -79,7 +80,57 @@ export_runUpdate:
7980
$(UVE) lock -U
8081

8182
com commit:
82-
$(UVE) run cz commit
83+
echo "" > .commit_msg
84+
@if curl -sf http://ollama:11434; then \
85+
$(MAKE) message; \
86+
else \
87+
$(UVE) run cz commit; \
88+
fi
89+
echo "" > .commit_msg
8390

8491
recom recommit:
85-
$(UVE) run cz commit --retry
92+
@if curl -sf http://ollama:11434; then \
93+
[ ! -s .commit_msg ] || (echo "Missing commit message!" && exit 1); \
94+
git commit -F .commit_msg; \
95+
else \
96+
$(UVE) run cz commit; \
97+
fi
98+
echo "" > .commit_msg
99+
100+
PROMPT=Generate a commit message in the Conventional Commits 1.0.0 format based on the following git diff. The commit message must: \n\
101+
- Follow this structure: \n\
102+
1. Commit type (e.g., feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert) \n\
103+
2. Optional scope in parentheses (e.g., feat(auth):) \n\
104+
3. A brief, lowercase description in present tense on the first line \n\
105+
4. Optional body with detailed explanation (can use uppercase) \n\
106+
5. Optional footer(s) with breaking changes, issue references (e.g., Closes \#123), or co-authors (e.g., Co-authored-by: Name) \n\
107+
- Formatting rules: \n\
108+
1. The first line must be entirely lowercase \n\
109+
2. Body and footer may use uppercase letters \n\
110+
3. Follow Conventional Commits 1.0.0 strictly \n\
111+
4. Return only the commit message as plain text (no extra formatting, no markdown) \n\
112+
5. Do NOT mention - no breaking changes \n\
113+
6. Body lines must not be longer than 100 characters \n\
114+
- Example: \n\
115+
feat(auth): add user login API\n\
116+
\n\
117+
Added support for user login via OAuth2. This allows users to authenticate\n\
118+
using their Google account.\n\
119+
\n\
120+
Closes \#42\n\
121+
122+
123+
message:
124+
git diff --staged -- . ':(exclude)*requirements*.txt' | \
125+
jq -Rs --arg prompt "$(PROMPT)" '{"stream": false, "model": "$(OLLAMA_MODEL)", "prompt": (" <GIT_DIFF> " + . + " </GIT_DIFF> " + $$prompt)}' | \
126+
curl -s -X POST http://ollama:11434/api/generate \
127+
-H "Content-Type: application/json" \
128+
-d @- | \
129+
jq -r 'select(.done == true) | .response' > .commit_msg
130+
vim .commit_msg
131+
@if ! $(UVE) run cz check --commit-msg-file .commit_msg; then \
132+
echo "Commit message failed cz check. Aborting."; \
133+
echo "" > .commit_msg; \
134+
exit 1; \
135+
fi
136+
git commit -F .commit_msg

0 commit comments

Comments
 (0)