-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (79 loc) · 2.84 KB
/
Copy pathMakefile
File metadata and controls
98 lines (79 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
.PHONY: build run commit test clean setup help install lint typecheck
# Docker settings
DOCKER_COMPOSE = docker-compose
SERVICE_NAME = llmcommit
# Default target
help:
@echo "Available commands:"
@echo " build - Build Docker image"
@echo " setup - Initial setup (build and download models)"
@echo " commit - Generate and create commit message"
@echo " commit-all - Auto-add files and commit"
@echo " fast-commit - Fast commit (auto-add + skip hooks)"
@echo " dry-run - Generate commit message without committing"
@echo " test - Run tests"
@echo " lint - Run linting"
@echo " typecheck - Run type checking"
@echo " clean - Clean up Docker images and volumes"
@echo " shell - Start interactive shell in container"
@echo " install - Install locally (non-Docker)"
@echo " install-dev - Install in development mode"
@echo " benchmark - Run model benchmark"
# Build Docker image
build:
$(DOCKER_COMPOSE) build
# Initial setup
setup: build
@echo "Downloading models on first run..."
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) --help
# Generate commit message and commit
commit:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME)
# Generate commit message and commit (with auto-add)
commit-all:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) -a
# Fast commit (auto-add + no-verify)
fast-commit:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) -a --no-verify
# Generate commit message (dry run)
dry-run:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) --dry-run
# Run with custom preset
commit-preset:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) --preset $(PRESET)
# Run tests
test:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) python -m pytest tests/ -v
# Run linting
lint:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) python -m flake8 src/ tests/
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) python -m black --check src/ tests/
# Run type checking
typecheck:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) python -m mypy src/
# Interactive shell
shell:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) /bin/bash
# Clean up
clean:
$(DOCKER_COMPOSE) down --volumes --rmi all
# Local installation (production)
install:
pip install .
# Local installation (development)
install-dev:
pip install -e ".[dev]"
# Benchmark different presets
benchmark:
@echo "Running benchmark for different presets..."
@echo "Testing ultra-fast preset..."
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) --preset ultra-fast --dry-run
@echo "Testing ultra-light preset..."
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) --preset ultra-light --dry-run
@echo "Testing balanced preset..."
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) --preset balanced --dry-run
# Cache management
cache-clear:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) llmcommit-cache clear
cache-stats:
$(DOCKER_COMPOSE) run --rm $(SERVICE_NAME) llmcommit-cache stats