Skip to content

Commit 6ed5989

Browse files
Arakissclaude
andcommitted
refactor: comprehensive project cleanup and architectural improvements
- Add missing __init__.py files to all modules for proper package structure - Create .env.example template for user configuration guidance - Consolidate release scripts (remove Poetry-based, keep UV-based) - Reorganize test fixtures (move test_batch to tests/fixtures/) - Update Dockerfile to Python 3.13 and UV sync workflow - Enhance README with ASCII art showcase and .env.example references - Update .gitignore with IDE, macOS, and project-specific patterns - Fix circular imports between cli and core modules All 133 tests passing with 72.56% coverage. Project structure is now professional and maintainable, ready for v1.6.4 release. 🧵 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3c79b57 commit 6ed5989

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+381
-525
lines changed

.env.example

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CommitLoom Environment Configuration
2+
# Copy this file to .env and fill in your actual values
3+
4+
# ===== Required Configuration =====
5+
6+
# OpenAI API Key (required for AI-powered commit messages)
7+
# Get your key from: https://platform.openai.com/api-keys
8+
OPENAI_API_KEY=your-openai-api-key-here
9+
10+
# ===== Optional Configuration =====
11+
12+
# Default AI Model to use (optional)
13+
# Available models: gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o-mini, gpt-4o, gpt-3.5-turbo
14+
# Default: gpt-4.1-mini
15+
MODEL_NAME=gpt-4.1-mini
16+
17+
# Enable debug mode (optional)
18+
# Set to true, 1, or yes to enable verbose logging
19+
# DEBUG_MODE=false
20+
21+
# ===== Advanced Configuration =====
22+
23+
# Maximum tokens for a single commit (optional)
24+
# Default: 4000
25+
# MAX_TOKENS=4000
26+
27+
# Token warning threshold (optional)
28+
# Default: 3000
29+
# TOKEN_WARNING_THRESHOLD=3000

.gitignore

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,20 @@ pyrightconfig.json
177177

178178
# End of https://www.toptal.com/developers/gitignore/api/python
179179

180-
# CommitLoom
181-
.loom/
180+
# CommitLoom specific
181+
.loom/
182+
183+
# IDE
184+
.vscode/
185+
.idea/
186+
187+
# macOS
188+
.DS_Store
189+
190+
# Temporary and backup files
191+
*.swp
192+
*.swo
193+
*~
194+
195+
# Release artifacts
196+
release_uv.py

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Multi-stage build for optimal image size
2-
FROM python:3.11-slim as builder
2+
FROM python:3.13-slim as builder
33

44
# Install uv
55
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
@@ -8,15 +8,16 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
88
WORKDIR /app
99

1010
# Copy dependency files
11-
COPY pyproject.toml ./
11+
COPY pyproject.toml uv.lock* ./
12+
COPY commitloom/ ./commitloom/
1213

1314
# Create virtual environment and install dependencies
1415
RUN uv venv .venv && \
1516
. .venv/bin/activate && \
16-
uv pip install -e .
17+
uv sync --frozen
1718

1819
# Final stage
19-
FROM python:3.11-slim
20+
FROM python:3.13-slim
2021

2122
# Set working directory
2223
WORKDIR /app

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ loom # Interactive mode
6161
loom -y # Non-interactive mode
6262
```
6363

64+
5. Check out the beautiful ASCII art:
65+
66+
```bash
67+
loom --version # Display version with ASCII art banner
68+
loom help # Full help with styled sections
69+
```
70+
6471
## ✨ Features
6572

6673
- 🤖 **AI-Powered Analysis**: Intelligently analyzes your changes and generates structured, semantic commit messages
@@ -72,7 +79,8 @@ loom -y # Non-interactive mode
7279
- 📈 **Usage Metrics**: Track your usage, cost savings, and productivity gains with built-in metrics
7380
- 🔍 **Binary Support**: Special handling for binary files with size and type detection
7481
-**UV Support**: Compatible with UV package manager for faster dependency management
75-
- 🎨 **Beautiful CLI**: Rich, colorful interface with clear insights and warnings
82+
- 🎨 **Beautiful CLI**: Rich, colorful interface with ASCII art logo and inspirational commit messages
83+
-**Professional Polish**: Inspirational quotes about code transparency after successful commits
7684

7785
## 🧠 Smart File Grouping
7886

@@ -189,9 +197,13 @@ export OPENAI_API_KEY=your-api-key
189197
export COMMITLOOM_API_KEY=your-api-key
190198
```
191199

192-
2. Project-level `.env` file:
200+
2. Project-level `.env` file (copy `.env.example` to `.env` and fill in your values):
193201

194-
```env
202+
```bash
203+
# Copy the example file
204+
cp .env.example .env
205+
206+
# Edit with your API key
195207
OPENAI_API_KEY=your-api-key
196208
# or
197209
COMMITLOOM_API_KEY=your-api-key

commitloom/cli/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""CLI module for CommitLoom.
2+
3+
This module contains the command-line interface components including
4+
the main CLI handler and console output utilities.
5+
"""
6+
7+
from . import console
8+
from .cli_handler import CommitLoom
9+
10+
__all__ = [
11+
"CommitLoom",
12+
"console",
13+
]

commitloom/config/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Configuration module for CommitLoom.
2+
3+
This module handles all configuration settings and environment variables.
4+
"""
5+
6+
from .settings import Config, config
7+
8+
__all__ = [
9+
"Config",
10+
"config",
11+
]

commitloom/core/__init__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""Core modules for CommitLoom.
2+
3+
This module contains the core functionality including:
4+
- Git operations
5+
- Commit analysis
6+
- Batch processing
7+
- Smart file grouping
8+
"""
9+
10+
from .analyzer import CommitAnalysis, CommitAnalyzer, Warning, WarningLevel
11+
from .batch import BatchProcessor
12+
from .git import GitError, GitFile, GitOperations
13+
from .smart_grouping import SmartGrouper
14+
15+
__all__ = [
16+
"CommitAnalyzer",
17+
"CommitAnalysis",
18+
"Warning",
19+
"WarningLevel",
20+
"GitOperations",
21+
"GitFile",
22+
"GitError",
23+
"BatchProcessor",
24+
"SmartGrouper",
25+
]

commitloom/core/batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from dataclasses import dataclass
44

5-
from ..cli.cli_handler import console
5+
from ..cli import console
66
from ..core.git import GitOperations
77

88

commitloom/services/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""Services module for CommitLoom.
2+
3+
This module contains service integrations including:
4+
- AI service for commit message generation
5+
- Metrics tracking and statistics
6+
"""
7+
8+
from .ai_service import AIService, CommitSuggestion, TokenUsage
9+
from .metrics import MetricsManager
10+
11+
__all__ = [
12+
"AIService",
13+
"CommitSuggestion",
14+
"TokenUsage",
15+
"MetricsManager",
16+
]

0 commit comments

Comments
 (0)