smart-commit-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smart_commit_cli-0.1.0/.env.example +12 -0
- smart_commit_cli-0.1.0/.gitattributes +2 -0
- smart_commit_cli-0.1.0/.gitignore +0 -0
- smart_commit_cli-0.1.0/.smart_commit_cache/cache.json +1 -0
- smart_commit_cli-0.1.0/CHANGELOG.md +154 -0
- smart_commit_cli-0.1.0/CONTRIBUTING.md +319 -0
- smart_commit_cli-0.1.0/PKG-INFO +804 -0
- smart_commit_cli-0.1.0/README.md +771 -0
- smart_commit_cli-0.1.0/next_phase.md +696 -0
- smart_commit_cli-0.1.0/prd.md +1049 -0
- smart_commit_cli-0.1.0/pyproject.toml +74 -0
- smart_commit_cli-0.1.0/smart_commit/__init__.py +6 -0
- smart_commit_cli-0.1.0/smart_commit/ai/__init__.py +7 -0
- smart_commit_cli-0.1.0/smart_commit/ai/client.py +123 -0
- smart_commit_cli-0.1.0/smart_commit/ai/reviewer.py +91 -0
- smart_commit_cli-0.1.0/smart_commit/ai.py +136 -0
- smart_commit_cli-0.1.0/smart_commit/analysis/__init__.py +7 -0
- smart_commit_cli-0.1.0/smart_commit/analysis/ast_parser.py +173 -0
- smart_commit_cli-0.1.0/smart_commit/analysis/dependency_graph.py +114 -0
- smart_commit_cli-0.1.0/smart_commit/analysis/diff_parser.py +172 -0
- smart_commit_cli-0.1.0/smart_commit/analysis/summarizer.py +101 -0
- smart_commit_cli-0.1.0/smart_commit/analysis/symbol_extractor.py +88 -0
- smart_commit_cli-0.1.0/smart_commit/benchmark.py +88 -0
- smart_commit_cli-0.1.0/smart_commit/cache.py +65 -0
- smart_commit_cli-0.1.0/smart_commit/cli.py +391 -0
- smart_commit_cli-0.1.0/smart_commit/clustering/__init__.py +7 -0
- smart_commit_cli-0.1.0/smart_commit/clustering/graph_clustering.py +78 -0
- smart_commit_cli-0.1.0/smart_commit/clustering/heuristic.py +178 -0
- smart_commit_cli-0.1.0/smart_commit/clustering/semantic.py +201 -0
- smart_commit_cli-0.1.0/smart_commit/clustering.py +186 -0
- smart_commit_cli-0.1.0/smart_commit/commit_messages.py +232 -0
- smart_commit_cli-0.1.0/smart_commit/committer.py +91 -0
- smart_commit_cli-0.1.0/smart_commit/config.py +88 -0
- smart_commit_cli-0.1.0/smart_commit/constants.py +92 -0
- smart_commit_cli-0.1.0/smart_commit/diff_parser.py +158 -0
- smart_commit_cli-0.1.0/smart_commit/embeddings/__init__.py +7 -0
- smart_commit_cli-0.1.0/smart_commit/embeddings/generator.py +128 -0
- smart_commit_cli-0.1.0/smart_commit/embeddings/similarity.py +159 -0
- smart_commit_cli-0.1.0/smart_commit/embeddings.py +108 -0
- smart_commit_cli-0.1.0/smart_commit/exceptions.py +102 -0
- smart_commit_cli-0.1.0/smart_commit/execution/__init__.py +6 -0
- smart_commit_cli-0.1.0/smart_commit/execution/committer.py +102 -0
- smart_commit_cli-0.1.0/smart_commit/git/__init__.py +8 -0
- smart_commit_cli-0.1.0/smart_commit/git/safety.py +75 -0
- smart_commit_cli-0.1.0/smart_commit/git/scanner.py +182 -0
- smart_commit_cli-0.1.0/smart_commit/git/service.py +129 -0
- smart_commit_cli-0.1.0/smart_commit/git_service.py +302 -0
- smart_commit_cli-0.1.0/smart_commit/logger.py +99 -0
- smart_commit_cli-0.1.0/smart_commit/models.py +73 -0
- smart_commit_cli-0.1.0/smart_commit/plugins/__init__.py +6 -0
- smart_commit_cli-0.1.0/smart_commit/plugins/base.py +135 -0
- smart_commit_cli-0.1.0/smart_commit/plugins/django.py +40 -0
- smart_commit_cli-0.1.0/smart_commit/plugins/fastapi.py +39 -0
- smart_commit_cli-0.1.0/smart_commit/plugins/react.py +49 -0
- smart_commit_cli-0.1.0/smart_commit/preview/__init__.py +6 -0
- smart_commit_cli-0.1.0/smart_commit/preview/editor.py +224 -0
- smart_commit_cli-0.1.0/smart_commit/preview/renderer.py +94 -0
- smart_commit_cli-0.1.0/smart_commit/preview.py +131 -0
- smart_commit_cli-0.1.0/smart_commit/summarizer.py +93 -0
- smart_commit_cli-0.1.0/smart_commit/utils.py +83 -0
- smart_commit_cli-0.1.0/tests/__init__.py +2 -0
- smart_commit_cli-0.1.0/tests/test_clustering.py +86 -0
- smart_commit_cli-0.1.0/tests/test_commit_messages.py +95 -0
- smart_commit_cli-0.1.0/tests/test_diff_parser.py +59 -0
- smart_commit_cli-0.1.0/tests/test_git_service.py +55 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# LLM Configuration
|
|
2
|
+
SMART_COMMIT_PROVIDER=openrouter
|
|
3
|
+
SMART_COMMIT_MODEL=anthropic/claude-sonnet
|
|
4
|
+
SMART_COMMIT_API_KEY=your-api-key-here
|
|
5
|
+
|
|
6
|
+
# Optional: Embedding Model
|
|
7
|
+
# SMART_COMMIT_EMBEDDING_MODEL=all-MiniLM-L6-v2
|
|
8
|
+
|
|
9
|
+
# Optional: Behavior
|
|
10
|
+
# SMART_COMMIT_INTERACTIVE=true
|
|
11
|
+
# SMART_COMMIT_AUTO_PUSH=false
|
|
12
|
+
# SMART_COMMIT_CONVENTIONAL_COMMITS=true
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"summaries_f7707885b44d20743f040267e0d7dfb4": "Added _extract_js_functions. Introduced dependencies on import tree_sitter_javascript as ts_js, import tree_sitter.", "summaries_38c82d20a03c5c23c011ec7b980b9c32": "Introduced dependencies on from ..cache import cache_manager.", "summaries_19dbd2b0784c9333dd2e15c9887c134e": "Added command_benchmark. Introduced dependencies on from .preview import PreviewRenderer, InteractiveEditor, from ric...", "summaries_9fdcbae5302c84770ce2fa1542dedbb3": "Added _generate_reason.", "summaries_21b5c866caccdc3b0cb852b01b6caee2": "Introduced dependencies on from ..cache import cache_manager.", "summaries_a3f82fe7357e6a66d247221408f03572": "Removed _check_symbol_overlap, _check_import_overlap, _filename_similarity. Introduced dependencies on from typing im...", "summaries_26608a8e89bb53e7eb0d602cd4bd5d38": "Added SymbolExtraction.", "summaries_1fed4521e7148f507c5d5b3754c4c7df": "Removed get_commit_hints, should_group_files, get_ignored_files. Introduced dependencies on from .django import Djang...", "summaries_3ad48235cc842c941fc3dd5652897e4a": "Introduced dependencies on editor, from .editor import InteractiveEditor.", "summaries_884708e8befad05a8f1bdd2af24d0681": "Removed get_confirmation, edit_messages.", "summaries_46b37c32018786696e440af3acde1904": "Added __init__, SymbolExtractor, extract_symbols. Introduced dependencies on from ..models import FileDiff, SymbolExt...", "summaries_8cf0e55c6fa9911533b4edb367e9714c": "Added BenchmarkHarness, __init__, run. Introduced dependencies on pathlib, import time, from rich.table import Table.", "summaries_ee7eb86c1e08e80c2d4206d6e804bd13": "Added _save_cache, __init__, set and more. Introduced dependencies on import hashlib, pathlib, hashlib.", "summaries_064200f53ebaecc9706b88b7d11f731f": "Added get_commit_hints, DjangoPlugin, get_ignored_files. Introduced dependencies on from .base import Plugin, models,...", "summaries_33ae44914ed1b80b157c3abec6e05775": "Added get_commit_hints, FastAPIPlugin, get_ignored_files. Introduced dependencies on from .base import Plugin, models...", "summaries_3cdb1e4acac84ec15485964c7d3d32fc": "Added get_commit_hints, ReactPlugin, should_group_files and more. Introduced dependencies on from .base import Plugin...", "summaries_0293e572a27e36cdd97473558cb160c5": "Added InteractiveEditor, _action_delete, __init__ and more. Introduced dependencies on uuid, from .renderer import Pr...", "summaries_1cf2566b79cab33f4d50464f4b159119": "Added new content", "summaries_274a78a8c939c5b5a438d03a82704fd1": "Added test. Introduced dependencies on import os, networkx, os.", "dependency_graph_77928d4edaed701f6e3835d1b6d2292c": [["smart_commit/execution/committer.py", "utils"], ["smart_commit/clustering/__init__.py", "heuristic"], ["smart_commit/cli.py", "git"], ["smart_commit/utils.py", "os"], ["smart_commit/config.py", "typing"], ["dummy_file.py", "networkx"], ["smart_commit/utils.py", "typing"], ["smart_commit/plugins/base.py", "react"], ["smart_commit/preview/renderer.py", "constants"], ["smart_commit/git/service.py", "models"], ["tests/test_git_service.py", "smart_commit.git_service"], ["smart_commit/benchmark.py", "pathlib"], ["smart_commit/embeddings/similarity.py", "logger"], ["smart_commit/ai/reviewer.py", "logger"], ["smart_commit/ai/client.py", "re"], ["smart_commit/logger.py", "typing"], ["smart_commit/embeddings/generator.py", "logger"], ["smart_commit/embeddings/__init__.py", "similarity"], ["smart_commit/git_service.py", "git.exc"], ["smart_commit/analysis/summarizer.py", "models"], ["smart_commit/clustering/graph_clustering.py", "models"], ["smart_commit/plugins/django.py", "typing"], ["smart_commit/benchmark.py", "git"], ["smart_commit/diff_parser.py", "re"], ["smart_commit/clustering/graph_clustering.py", "numpy"], ["smart_commit/embeddings/similarity.py", "analysis.dependency_graph"], ["smart_commit/preview/editor.py", "rich.console"], ["smart_commit/analysis/summarizer.py", "diff_parser"], ["smart_commit/preview/renderer.py", "rich.table"], ["smart_commit/clustering/semantic.py", "analysis.dependency_graph"], ["smart_commit/preview/editor.py", "typing"], ["smart_commit/git/service.py", "subprocess"], ["smart_commit/utils.py", "sys"], ["smart_commit/plugins/base.py", "logger"], ["tests/test_commit_messages.py", "pytest"], ["smart_commit/plugins/fastapi.py", "base"], ["smart_commit/benchmark.py", "time"], ["smart_commit/logger.py", "sys"], ["smart_commit/preview/renderer.py", "rich.panel"], ["smart_commit/committer.py", "models"], ["smart_commit/cache.py", "logger"], ["smart_commit/config.py", "pathlib"], ["smart_commit/utils.py", "pathlib"], ["smart_commit/git_service.py", "models"], ["smart_commit/git/__init__.py", "scanner"], ["smart_commit/analysis/symbol_extractor.py", "models"], ["smart_commit/preview/__init__.py", "editor"], ["smart_commit/plugins/django.py", "base"], ["smart_commit/logger.py", "pathlib"], ["smart_commit/clustering/heuristic.py", "logger"], ["smart_commit/diff_parser.py", "models"], ["smart_commit/preview/renderer.py", "models"], ["smart_commit/commit_messages.py", "config"], ["smart_commit/git/safety.py", "exceptions"], ["smart_commit/git/__init__.py", "service"], ["smart_commit/clustering/semantic.py", "embeddings"], ["tests/test_git_service.py", "pathlib"], ["smart_commit/cli.py", "exceptions"], ["smart_commit/preview.py", "rich.table"], ["smart_commit/git/scanner.py", "exceptions"], ["tests/test_git_service.py", "git"], ["smart_commit/config.py", "yaml"], ["smart_commit/clustering.py", "sklearn.cluster"], ["dummy_file.py", "os"], ["smart_commit/embeddings/similarity.py", "typing"], ["smart_commit/plugins/react.py", "models"], ["smart_commit/ai/reviewer.py", "typing"], ["smart_commit/analysis/__init__.py", "diff_parser"], ["smart_commit/clustering/graph_clustering.py", "networkx"], ["smart_commit/cli.py", "config"], ["smart_commit/cli.py", "rich.progress"], ["smart_commit/clustering/semantic.py", "typing"], ["tests/test_commit_messages.py", "smart_commit.models"], ["smart_commit/clustering.py", "models"], ["smart_commit/clustering.py", "numpy"], ["smart_commit/logger.py", "logging"], ["smart_commit/committer.py", "git_service"], ["smart_commit/cli.py", "plugins"], ["smart_commit/ai/client.py", "typing"], ["smart_commit/plugins/base.py", "fastapi"], ["smart_commit/analysis/symbol_extractor.py", "typing"], ["smart_commit/embeddings/generator.py", "cache"], ["smart_commit/plugins/base.py", "typing"], ["smart_commit/diff_parser.py", "typing"], ["smart_commit/preview.py", "models"], ["tests/test_git_service.py", "pytest"], ["smart_commit/analysis/ast_parser.py", "tree_sitter"], ["smart_commit/clustering/semantic.py", "logger"], ["smart_commit/ai/reviewer.py", "client"], ["smart_commit/cache.py", "typing"], ["smart_commit/cli.py", "constants"], ["smart_commit/ai/client.py", "constants"], ["smart_commit/ai/client.py", "logger"], ["smart_commit/analysis/symbol_extractor.py", "logger"], ["smart_commit/plugins/fastapi.py", "models"], ["smart_commit/constants.py", "pathlib"], ["smart_commit/ai/reviewer.py", "json"], ["smart_commit/clustering/semantic.py", "pathlib"], ["smart_commit/ai/__init__.py", "client"], ["smart_commit/analysis/symbol_extractor.py", "ast_parser"], ["smart_commit/ai.py", "json"], ["smart_commit/analysis/dependency_graph.py", "os"], ["smart_commit/analysis/dependency_graph.py", "typing"], ["smart_commit/ai.py", "litellm"], ["smart_commit/utils.py", "json"], ["smart_commit/plugins/base.py", "pathlib"], ["smart_commit/commit_messages.py", "models"], ["smart_commit/git/__init__.py", "safety"], ["smart_commit/git/service.py", "typing"], ["smart_commit/preview/renderer.py", "rich.tree"], ["smart_commit/plugins/__init__.py", "base"], ["smart_commit/benchmark.py", "rich.table"], ["smart_commit/models.py", "enum"], ["smart_commit/clustering/semantic.py", "graph_clustering"], ["smart_commit/git/service.py", "scanner"], ["smart_commit/cache.py", "pathlib"], ["smart_commit/clustering/graph_clustering.py", "typing"], ["smart_commit/analysis/dependency_graph.py", "logger"], ["smart_commit/execution/committer.py", "models"], ["smart_commit/clustering/__init__.py", "semantic"], ["smart_commit/clustering/graph_clustering.py", "networkx.algorithms.community"], ["smart_commit/cli.py", "analysis"], ["smart_commit/models.py", "dataclasses"], ["smart_commit/cli.py", "models"], ["smart_commit/analysis/dependency_graph.py", "ast_parser"], ["smart_commit/git/service.py", "logger"], ["smart_commit/analysis/diff_parser.py", "re"], ["smart_commit/git/scanner.py", "models"], ["tests/test_clustering.py", "pytest"], ["smart_commit/summarizer.py", "diff_parser"], ["smart_commit/utils.py", "datetime"], ["smart_commit/analysis/dependency_graph.py", "pathlib"], ["smart_commit/preview.py", "rich.panel"], ["smart_commit/committer.py", "typing"], ["smart_commit/analysis/summarizer.py", "logger"], ["smart_commit/clustering/graph_clustering.py", "logger"], ["smart_commit/preview/editor.py", "rich.prompt"], ["smart_commit/benchmark.py", "analysis"], ["smart_commit/logger.py", "datetime"], ["smart_commit/preview/editor.py", "renderer"], ["smart_commit/commit_messages.py", "typing"], ["smart_commit/git_service.py", "typing"], ["smart_commit/git/service.py", "pathlib"], ["smart_commit/preview/renderer.py", "rich.console"], ["smart_commit/git/scanner.py", "subprocess"], ["smart_commit/cli.py", "analysis.symbol_extractor"], ["tests/test_diff_parser.py", "smart_commit.diff_parser"], ["smart_commit/embeddings/generator.py", "models"], ["smart_commit/clustering.py", "embeddings"], ["smart_commit/embeddings/generator.py", "numpy"], ["smart_commit/execution/__init__.py", "committer"], ["smart_commit/plugins/base.py", "django"], ["tests/test_commit_messages.py", "smart_commit.commit_messages"], ["smart_commit/analysis/diff_parser.py", "models"], ["tests/test_git_service.py", "git.exc"], ["smart_commit/git/scanner.py", "dataclasses"], ["smart_commit/benchmark.py", "analysis.symbol_extractor"], ["smart_commit/git/scanner.py", "constants"], ["smart_commit/cli.py", "execution"], ["smart_commit/plugins/react.py", "typing"], ["smart_commit/committer.py", "pathlib"], ["smart_commit/ai.py", "config"], ["smart_commit/embeddings.py", "models"], ["smart_commit/cli.py", "clustering"], ["smart_commit/embeddings.py", "numpy"], ["smart_commit/utils.py", "hashlib"], ["smart_commit/clustering.py", "typing"], ["tests/test_diff_parser.py", "pytest"], ["tests/test_clustering.py", "smart_commit.models"], ["smart_commit/ai/client.py", "json"], ["smart_commit/git_service.py", "pathlib"], ["smart_commit/execution/committer.py", "logger"], ["smart_commit/analysis/ast_parser.py", "tree_sitter_javascript"], ["smart_commit/git/safety.py", "logger"], ["smart_commit/plugins/django.py", "models"], ["smart_commit/cli.py", "sys"], ["smart_commit/cli.py", "logger"], ["smart_commit/preview.py", "rich.console"], ["smart_commit/ai/client.py", "litellm"], ["smart_commit/git_service.py", "git"], ["smart_commit/ai/__init__.py", "reviewer"], ["smart_commit/benchmark.py", "clustering"], ["smart_commit/cli.py", "commit_messages"], ["smart_commit/utils.py", "uuid"], ["smart_commit/preview/editor.py", "models"], ["smart_commit/preview.py", "typing"], ["smart_commit/analysis/dependency_graph.py", "cache"], ["smart_commit/embeddings/similarity.py", "constants"], ["smart_commit/clustering/heuristic.py", "models"], ["smart_commit/embeddings/generator.py", "constants"], ["smart_commit/cache.py", "json"], ["smart_commit/embeddings/similarity.py", "generator"], ["smart_commit/ai/client.py", "time"], ["smart_commit/plugins/react.py", "base"], ["smart_commit/embeddings.py", "sentence_transformers"], ["smart_commit/clustering/semantic.py", "heuristic"], ["smart_commit/plugins/fastapi.py", "typing"], ["smart_commit/config.py", "dataclasses"], ["smart_commit/preview/editor.py", "uuid"], ["smart_commit/summarizer.py", "models"], ["smart_commit/analysis/summarizer.py", "cache"], ["smart_commit/config.py", "os"], ["smart_commit/benchmark.py", "analysis.dependency_graph"], ["smart_commit/models.py", "typing"], ["smart_commit/embeddings.py", "typing"], ["smart_commit/logger.py", "constants"], ["smart_commit/analysis/ast_parser.py", "typing"], ["smart_commit/cli.py", "argparse"], ["smart_commit/analysis/ast_parser.py", "ast"], ["smart_commit/embeddings/__init__.py", "generator"], ["smart_commit/analysis/diff_parser.py", "logger"], ["smart_commit/analysis/__init__.py", "summarizer"], ["smart_commit/clustering/semantic.py", "sklearn.cluster"], ["smart_commit/analysis/ast_parser.py", "logger"], ["smart_commit/embeddings/similarity.py", "models"], ["smart_commit/git/service.py", "utils"], ["smart_commit/ai/reviewer.py", "models"], ["smart_commit/embeddings/similarity.py", "numpy"], ["smart_commit/git/safety.py", "typing"], ["smart_commit/clustering/semantic.py", "models"], ["smart_commit/clustering/semantic.py", "numpy"], ["smart_commit/ai/client.py", "exceptions"], ["smart_commit/ai.py", "models"], ["smart_commit/cli.py", "typing"], ["smart_commit/summarizer.py", "typing"], ["smart_commit/git/scanner.py", "typing"], ["smart_commit/plugins/base.py", "models"], ["smart_commit/benchmark.py", "rich.console"], ["smart_commit/cli.py", "preview"], ["smart_commit/analysis/symbol_extractor.py", "diff_parser"], ["smart_commit/ai/client.py", "config"], ["smart_commit/constants.py", "enum"], ["tests/test_clustering.py", "smart_commit.clustering"], ["smart_commit/analysis/dependency_graph.py", "networkx"], ["smart_commit/cli.py", "benchmark"], ["smart_commit/cache.py", "hashlib"], ["smart_commit/committer.py", "utils"], ["smart_commit/config.py", "dotenv"], ["smart_commit/embeddings/generator.py", "sentence_transformers"], ["smart_commit/embeddings/similarity.py", "dataclasses"], ["smart_commit/preview/__init__.py", "renderer"], ["smart_commit/git_service.py", "utils"], ["smart_commit/plugins/base.py", "abc"], ["smart_commit/git/safety.py", "pathlib"], ["smart_commit/clustering/semantic.py", "constants"], ["smart_commit/embeddings/generator.py", "typing"], ["smart_commit/cli.py", "pathlib"], ["smart_commit/cli.py", "ai"], ["smart_commit/execution/committer.py", "git"], ["smart_commit/ai.py", "typing"], ["smart_commit/git/scanner.py", "pathlib"]], "summaries_943f2588ea9722c748559a67cc995b24": "Modified file", "summaries_07aee2946b00c8a027fe803f7fafa791": "Modified content"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Smart Commit are documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.2.0] - 2026-01-10 - v2 Architecture
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
#### Core Infrastructure
|
|
10
|
+
- **constants.py**: Configuration constants, enums for various states
|
|
11
|
+
- **exceptions.py**: Comprehensive exception hierarchy (15+ exception types)
|
|
12
|
+
- **logger.py**: Color-coded logging with session support
|
|
13
|
+
|
|
14
|
+
#### Architecture Reorganization
|
|
15
|
+
- **git/** package: Repository scanning, git operations, and safety checks
|
|
16
|
+
- `scanner.py`: RepositoryScanner for repository state analysis
|
|
17
|
+
- `service.py`: Refactored GitService with improved session management
|
|
18
|
+
- `safety.py`: SafetyChecker for pre-execution validation
|
|
19
|
+
|
|
20
|
+
- **analysis/** package: Enhanced code analysis
|
|
21
|
+
- `diff_parser.py`: Improved diff parser with language-specific symbol extraction
|
|
22
|
+
- `summarizer.py`: Conc ise summary generation (20-80 words)
|
|
23
|
+
- `ast_parser.py`: AST parsing for Python (foundation for other languages)
|
|
24
|
+
|
|
25
|
+
- **embeddings/** package: Semantic embeddings
|
|
26
|
+
- `generator.py`: EmbeddingsGenerator using SentenceTransformers
|
|
27
|
+
- `similarity.py`: SimilarityGraph with weighted multi-factor similarity
|
|
28
|
+
|
|
29
|
+
- **clustering/** package: File grouping algorithms
|
|
30
|
+
- `semantic.py`: ML-based clustering with Agglomerative and greedy fallback
|
|
31
|
+
- `heuristic.py`: Rule-based clustering by directory and file type
|
|
32
|
+
|
|
33
|
+
- **ai/** package: LLM integration
|
|
34
|
+
- `client.py`: LiteLLM wrapper with retry logic and error handling
|
|
35
|
+
- `reviewer.py`: ClusterReviewer for LLM-based cluster analysis
|
|
36
|
+
|
|
37
|
+
- **preview/** package: User interface
|
|
38
|
+
- `renderer.py`: Rich-based terminal UI with panels, trees, tables
|
|
39
|
+
|
|
40
|
+
- **execution/** package: Commit execution
|
|
41
|
+
- `committer.py`: Safe commit creation with dry-run support
|
|
42
|
+
|
|
43
|
+
- **plugins/** package: Extensible plugin system
|
|
44
|
+
- `base.py`: Plugin base class and registry
|
|
45
|
+
- Built-in: ReactPlugin, DjangoPlugin
|
|
46
|
+
|
|
47
|
+
#### Enhanced CLI
|
|
48
|
+
- New command: `smart-commit plugins`
|
|
49
|
+
- New options: `--yes`, `--dry-run`, `--offline`, `--no-ai`
|
|
50
|
+
- Model and provider overrides in CLI
|
|
51
|
+
- Full 7-step pipeline visualization
|
|
52
|
+
- Interactive preview with confirmation
|
|
53
|
+
|
|
54
|
+
#### Safety & Quality
|
|
55
|
+
- SafetyChecker validates files and commits before execution
|
|
56
|
+
- Protected branch detection (main, master, production)
|
|
57
|
+
- Comprehensive error handling with custom exceptions
|
|
58
|
+
- Session tracking for undo support
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
- Reorganized module structure for better maintainability
|
|
63
|
+
- Improved similarity graph with weighted factors
|
|
64
|
+
- Enhanced diff parser with better language support
|
|
65
|
+
- Updated CLI with new v2 commands
|
|
66
|
+
- Improved README with mermaid diagram and examples
|
|
67
|
+
|
|
68
|
+
### Documentation
|
|
69
|
+
|
|
70
|
+
- Comprehensive README v2 with architecture overview
|
|
71
|
+
- CONTRIBUTING.md with development guidelines
|
|
72
|
+
- Improved docstrings across all modules
|
|
73
|
+
- Architecture diagrams and workflow examples
|
|
74
|
+
|
|
75
|
+
## [0.1.0] - 2025-12-01 - Initial Release
|
|
76
|
+
|
|
77
|
+
### Added
|
|
78
|
+
|
|
79
|
+
#### Core Features
|
|
80
|
+
- Git repository scanning and file detection
|
|
81
|
+
- Diff parsing and structured change extraction
|
|
82
|
+
- File summarization and keyword extraction
|
|
83
|
+
- Semantic embeddings using sentence-transformers
|
|
84
|
+
- ML-based clustering (agglomerative, greedy fallback)
|
|
85
|
+
- LLM integration for cluster analysis
|
|
86
|
+
- Conventional commit message generation
|
|
87
|
+
- Rich terminal UI for preview
|
|
88
|
+
- Session tracking and undo support
|
|
89
|
+
|
|
90
|
+
#### CLI Commands
|
|
91
|
+
- `smart-commit run`: Main commit workflow
|
|
92
|
+
- `smart-commit preview`: Preview without executing
|
|
93
|
+
- `smart-commit undo`: Undo last session
|
|
94
|
+
- `smart-commit config`: Configuration management
|
|
95
|
+
- `smart-commit doctor`: Diagnostic checks
|
|
96
|
+
- `smart-commit init`: Repository initialization
|
|
97
|
+
- `smart-commit version`: Version info
|
|
98
|
+
|
|
99
|
+
#### Models & Configuration
|
|
100
|
+
- FileDiff dataclass for file changes
|
|
101
|
+
- CommitCluster dataclass for grouped changes
|
|
102
|
+
- CommitType enum for Conventional Commits
|
|
103
|
+
- SessionInfo for undo tracking
|
|
104
|
+
- Config class with Pydantic validation
|
|
105
|
+
|
|
106
|
+
#### Testing
|
|
107
|
+
- Basic test suite for git operations
|
|
108
|
+
- Tests for diff parsing
|
|
109
|
+
- Tests for clustering
|
|
110
|
+
- Tests for commit message generation
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Migration Guide: v1 to v2
|
|
115
|
+
|
|
116
|
+
If you're upgrading from v0.1.0 to v0.2.0:
|
|
117
|
+
|
|
118
|
+
### Breaking Changes
|
|
119
|
+
- Module structure reorganized (imports may need updating)
|
|
120
|
+
- New exception types for better error handling
|
|
121
|
+
- Configuration format unchanged (compatible)
|
|
122
|
+
|
|
123
|
+
### New Features to Explore
|
|
124
|
+
- Plugin system for framework-specific support
|
|
125
|
+
- Enhanced offline mode (`--offline` flag)
|
|
126
|
+
- Safety checker for protected branches
|
|
127
|
+
- Improved LLM cluster analysis
|
|
128
|
+
|
|
129
|
+
### Update Instructions
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Update from PyPI
|
|
133
|
+
pip install --upgrade smart-commit
|
|
134
|
+
|
|
135
|
+
# Or from source
|
|
136
|
+
git clone https://github.com/hamxa296/Smart-Commit.git
|
|
137
|
+
cd Smart-Commit
|
|
138
|
+
pip install -e .
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Planned for Future Releases
|
|
144
|
+
|
|
145
|
+
- [ ] Interactive commit editing UI
|
|
146
|
+
- [ ] Learning mode (observe user patterns)
|
|
147
|
+
- [ ] VS Code extension
|
|
148
|
+
- [ ] Cursor/Windsurf IDE support
|
|
149
|
+
- [ ] Pull request generation
|
|
150
|
+
- [ ] Changelog generation
|
|
151
|
+
- [ ] Team collaboration features
|
|
152
|
+
- [ ] Analytics and insights
|
|
153
|
+
- [ ] GitHub Actions integration
|
|
154
|
+
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# Contributing to Smart Commit
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to Smart Commit! This document provides guidelines and instructions for contributing.
|
|
4
|
+
|
|
5
|
+
## Code of Conduct
|
|
6
|
+
|
|
7
|
+
We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful and constructive in all interactions.
|
|
8
|
+
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
### Fork and Clone
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Fork the repository on GitHub
|
|
15
|
+
|
|
16
|
+
# Clone your fork
|
|
17
|
+
git clone https://github.com/YOUR_USERNAME/Smart-Commit.git
|
|
18
|
+
cd Smart-Commit
|
|
19
|
+
|
|
20
|
+
# Add upstream remote
|
|
21
|
+
git remote add upstream https://github.com/hamxa296/Smart-Commit.git
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Development Setup
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Create virtual environment
|
|
28
|
+
python -m venv venv
|
|
29
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
30
|
+
|
|
31
|
+
# Install in development mode
|
|
32
|
+
pip install -e ".[dev]"
|
|
33
|
+
|
|
34
|
+
# Run tests
|
|
35
|
+
pytest
|
|
36
|
+
|
|
37
|
+
# Format code
|
|
38
|
+
black smart_commit tests
|
|
39
|
+
ruff check --fix smart_commit tests
|
|
40
|
+
|
|
41
|
+
# Type checking
|
|
42
|
+
mypy smart_commit
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Development Workflow
|
|
46
|
+
|
|
47
|
+
### 1. Create a Feature Branch
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git checkout -b feature/your-feature-name
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Make Your Changes
|
|
54
|
+
|
|
55
|
+
- Write clean, well-documented code
|
|
56
|
+
- Follow the existing code style
|
|
57
|
+
- Add tests for new functionality
|
|
58
|
+
- Update documentation as needed
|
|
59
|
+
|
|
60
|
+
### 3. Test Your Changes
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Run all tests
|
|
64
|
+
pytest -v
|
|
65
|
+
|
|
66
|
+
# Run specific test
|
|
67
|
+
pytest tests/test_git_service.py -v
|
|
68
|
+
|
|
69
|
+
# Check coverage
|
|
70
|
+
pytest --cov=smart_commit
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 4. Format and Lint
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Format with Black
|
|
77
|
+
black smart_commit tests
|
|
78
|
+
|
|
79
|
+
# Lint with Ruff
|
|
80
|
+
ruff check --fix smart_commit tests
|
|
81
|
+
|
|
82
|
+
# Type check
|
|
83
|
+
mypy smart_commit
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 5. Commit and Push
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Commit with descriptive message
|
|
90
|
+
git commit -m "feat(module): describe your changes"
|
|
91
|
+
|
|
92
|
+
# Push to your fork
|
|
93
|
+
git push origin feature/your-feature-name
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 6. Create a Pull Request
|
|
97
|
+
|
|
98
|
+
Create a PR on GitHub with:
|
|
99
|
+
- Clear description of changes
|
|
100
|
+
- Reference to related issues
|
|
101
|
+
- Tests for new functionality
|
|
102
|
+
- Updated documentation
|
|
103
|
+
|
|
104
|
+
## Areas for Contribution
|
|
105
|
+
|
|
106
|
+
### High Priority
|
|
107
|
+
|
|
108
|
+
- [ ] AST parsing improvements for better code understanding
|
|
109
|
+
- [ ] Additional language plugins (Next.js, FastAPI, etc.)
|
|
110
|
+
- [ ] IDE extensions (VS Code, Cursor, Windsurf, JetBrains)
|
|
111
|
+
- [ ] Test coverage improvements
|
|
112
|
+
- [ ] Documentation enhancements
|
|
113
|
+
|
|
114
|
+
### Medium Priority
|
|
115
|
+
|
|
116
|
+
- [ ] Learning mode for user preferences
|
|
117
|
+
- [ ] Pull request generation
|
|
118
|
+
- [ ] Changelog generation
|
|
119
|
+
- [ ] Analytics dashboard
|
|
120
|
+
- [ ] Performance optimizations
|
|
121
|
+
|
|
122
|
+
### Low Priority
|
|
123
|
+
|
|
124
|
+
- [ ] UI themes
|
|
125
|
+
- [ ] Configuration profiles
|
|
126
|
+
- [ ] GitHub Actions integration
|
|
127
|
+
- [ ] Team collaboration features
|
|
128
|
+
|
|
129
|
+
## Code Style
|
|
130
|
+
|
|
131
|
+
### Python Style Guide
|
|
132
|
+
|
|
133
|
+
- Follow [PEP 8](https://www.python.org/dev/peps/pep-0008/)
|
|
134
|
+
- Use type hints for all functions
|
|
135
|
+
- Use docstrings (Google style) for modules, classes, and functions
|
|
136
|
+
- Maximum line length: 100 characters
|
|
137
|
+
- Use Black for formatting
|
|
138
|
+
|
|
139
|
+
### Example
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
"""Module docstring."""
|
|
143
|
+
|
|
144
|
+
def process_data(items: List[str], threshold: float = 0.5) -> Dict[str, int]:
|
|
145
|
+
"""Process a list of items.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
items: List of items to process.
|
|
149
|
+
threshold: Similarity threshold (default 0.5).
|
|
150
|
+
|
|
151
|
+
Returns:
|
|
152
|
+
Dictionary mapping item to score.
|
|
153
|
+
|
|
154
|
+
Raises:
|
|
155
|
+
ValueError: If threshold is not in [0, 1].
|
|
156
|
+
"""
|
|
157
|
+
if not (0 <= threshold <= 1):
|
|
158
|
+
raise ValueError("Threshold must be in [0, 1]")
|
|
159
|
+
|
|
160
|
+
result = {}
|
|
161
|
+
for item in items:
|
|
162
|
+
result[item] = len(item) * threshold
|
|
163
|
+
|
|
164
|
+
return result
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Commit Message Format
|
|
168
|
+
|
|
169
|
+
Follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
<type>(<scope>): <subject>
|
|
173
|
+
|
|
174
|
+
<body>
|
|
175
|
+
|
|
176
|
+
<footer>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Types
|
|
180
|
+
|
|
181
|
+
- `feat`: New feature
|
|
182
|
+
- `fix`: Bug fix
|
|
183
|
+
- `docs`: Documentation
|
|
184
|
+
- `style`: Code style changes
|
|
185
|
+
- `refactor`: Code refactoring
|
|
186
|
+
- `perf`: Performance improvement
|
|
187
|
+
- `test`: Test additions/changes
|
|
188
|
+
- `chore`: Build, dependencies, etc.
|
|
189
|
+
|
|
190
|
+
### Examples
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
feat(ai): add LLM cluster review
|
|
194
|
+
|
|
195
|
+
Implement ClusterReviewer that uses LLM to analyze
|
|
196
|
+
and suggest improvements to file clusters.
|
|
197
|
+
|
|
198
|
+
Closes #42
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
fix(clustering): handle empty embeddings gracefully
|
|
203
|
+
|
|
204
|
+
Prevent crashes when embedding generation fails
|
|
205
|
+
by using fallback clustering strategy.
|
|
206
|
+
|
|
207
|
+
Fixes #38
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Testing
|
|
211
|
+
|
|
212
|
+
### Test Structure
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
"""Tests for module_name."""
|
|
216
|
+
|
|
217
|
+
import pytest
|
|
218
|
+
from smart_commit.module_name import ClassName
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class TestClassName:
|
|
222
|
+
"""Test suite for ClassName."""
|
|
223
|
+
|
|
224
|
+
def test_basic_functionality(self):
|
|
225
|
+
"""Test basic functionality."""
|
|
226
|
+
obj = ClassName()
|
|
227
|
+
result = obj.method()
|
|
228
|
+
assert result is not None
|
|
229
|
+
|
|
230
|
+
def test_error_handling(self):
|
|
231
|
+
"""Test error handling."""
|
|
232
|
+
obj = ClassName()
|
|
233
|
+
|
|
234
|
+
with pytest.raises(ValueError):
|
|
235
|
+
obj.method_that_raises()
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Running Tests
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
# All tests
|
|
242
|
+
pytest
|
|
243
|
+
|
|
244
|
+
# Specific file
|
|
245
|
+
pytest tests/test_file.py
|
|
246
|
+
|
|
247
|
+
# Specific test
|
|
248
|
+
pytest tests/test_file.py::TestClass::test_method
|
|
249
|
+
|
|
250
|
+
# With output
|
|
251
|
+
pytest -v -s
|
|
252
|
+
|
|
253
|
+
# Coverage
|
|
254
|
+
pytest --cov=smart_commit --cov-report=html
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Documentation
|
|
258
|
+
|
|
259
|
+
### Docstring Format
|
|
260
|
+
|
|
261
|
+
Use Google-style docstrings:
|
|
262
|
+
|
|
263
|
+
```python
|
|
264
|
+
def function_name(param1: str, param2: int) -> bool:
|
|
265
|
+
"""Short description.
|
|
266
|
+
|
|
267
|
+
Longer description if needed. Explain what the function does,
|
|
268
|
+
its purpose, and any important details.
|
|
269
|
+
|
|
270
|
+
Args:
|
|
271
|
+
param1: Description of param1.
|
|
272
|
+
param2: Description of param2.
|
|
273
|
+
|
|
274
|
+
Returns:
|
|
275
|
+
Description of return value.
|
|
276
|
+
|
|
277
|
+
Raises:
|
|
278
|
+
ValueError: When input is invalid.
|
|
279
|
+
RuntimeError: When operation fails.
|
|
280
|
+
|
|
281
|
+
Example:
|
|
282
|
+
>>> result = function_name("test", 42)
|
|
283
|
+
>>> assert result is True
|
|
284
|
+
"""
|
|
285
|
+
pass
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### README Updates
|
|
289
|
+
|
|
290
|
+
When adding features, update README.md:
|
|
291
|
+
- Add to features list
|
|
292
|
+
- Add to commands section if CLI command
|
|
293
|
+
- Update architecture if module added
|
|
294
|
+
- Add to roadmap if incomplete
|
|
295
|
+
|
|
296
|
+
## Release Process
|
|
297
|
+
|
|
298
|
+
1. Update `__version__` in `smart_commit/__init__.py`
|
|
299
|
+
2. Update CHANGELOG.md
|
|
300
|
+
3. Update README.md if needed
|
|
301
|
+
4. Create git tag: `git tag v0.2.0`
|
|
302
|
+
5. Push: `git push upstream main --tags`
|
|
303
|
+
6. Create GitHub Release with notes
|
|
304
|
+
7. Build and publish to PyPI
|
|
305
|
+
|
|
306
|
+
## Questions or Issues
|
|
307
|
+
|
|
308
|
+
- Create a [GitHub Issue](https://github.com/hamxa296/Smart-Commit/issues)
|
|
309
|
+
- Start a [Discussion](https://github.com/hamxa296/Smart-Commit/discussions)
|
|
310
|
+
- Contact: [maintainer email]
|
|
311
|
+
|
|
312
|
+
## License
|
|
313
|
+
|
|
314
|
+
By contributing, you agree that your contributions will be licensed under the MIT License.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
Thank you for helping make Smart Commit better! 🙏
|
|
319
|
+
|