tgit 0.26.0__tar.gz → 0.29.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.
- tgit-0.29.0/AGENTS.md +44 -0
- {tgit-0.26.0 → tgit-0.29.0}/CHANGELOG.md +48 -0
- {tgit-0.26.0 → tgit-0.29.0}/PKG-INFO +5 -1
- {tgit-0.26.0 → tgit-0.29.0}/README.md +4 -0
- {tgit-0.26.0 → tgit-0.29.0}/pyproject.toml +2 -1
- {tgit-0.26.0 → tgit-0.29.0}/tests/integration/test_version_integration.py +6 -6
- tgit-0.29.0/tests/unit/test_changelog_coverage.py +78 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/test_commit.py +288 -23
- tgit-0.29.0/tests/unit/test_commit_coverage.py +78 -0
- tgit-0.29.0/tests/unit/test_utils_coverage.py +120 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/test_version.py +14 -1
- tgit-0.29.0/tests/unit/test_version_coverage.py +303 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/changelog.py +3 -1
- {tgit-0.26.0 → tgit-0.29.0}/tgit/commit.py +198 -38
- {tgit-0.26.0 → tgit-0.29.0}/tgit/constants.py +1 -1
- tgit-0.29.0/tgit/prompts/commit.txt +102 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/version.py +28 -8
- tgit-0.29.0/uv.lock +921 -0
- tgit-0.26.0/tgit/prompts/commit.txt +0 -75
- tgit-0.26.0/uv.lock +0 -902
- {tgit-0.26.0 → tgit-0.29.0}/.claude/settings.local.json +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/.github/workflows/build.yml +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/.github/workflows/ci.yml +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/.github/workflows/claude-code-review.yml +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/.github/workflows/claude.yml +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/.gitignore +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/.python-version +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/.tgit/settings.json +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/.vscode/extensions.json +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/.vscode/launch.json +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/CLAUDE.md +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/pyrightconfig.json +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/scripts/publish.sh +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/scripts/test.sh +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/README.md +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/__init__.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/conftest.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/integration/__init__.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/__init__.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/test_add.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/test_changelog.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/test_cli.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/test_interactive_settings.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/test_settings.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/test_types.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tests/unit/test_utils.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/__init__.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/add.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/cli.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/interactive_settings.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/settings.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/shared.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/types.py +0 -0
- {tgit-0.26.0 → tgit-0.29.0}/tgit/utils/__init__.py +0 -0
tgit-0.29.0/AGENTS.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Repository Guidelines
|
|
2
|
+
|
|
3
|
+
## Project Structure & Module Organization
|
|
4
|
+
|
|
5
|
+
- `tgit/` holds the Python package and CLI entry point. Key modules include `cli.py`, `commit.py`, `changelog.py`, `version.py`, and `settings.py`.
|
|
6
|
+
- `tgit/prompts/` contains Jinja2 prompt templates used by the AI commit flow.
|
|
7
|
+
- `tgit/utils/` hosts shared helpers.
|
|
8
|
+
- `tests/` is split into `tests/unit/` and `tests/integration/`, with shared fixtures in `tests/conftest.py`.
|
|
9
|
+
- `scripts/` contains automation such as `scripts/test.sh` and `scripts/publish.sh`.
|
|
10
|
+
- Generated artifacts live in `dist/`, `htmlcov/`, and `coverage.xml`.
|
|
11
|
+
|
|
12
|
+
## Build, Test, and Development Commands
|
|
13
|
+
|
|
14
|
+
- `uv sync` installs dependencies (use this for a fresh dev environment).
|
|
15
|
+
- `uv pip install -e ".[dev]"` installs in editable mode with dev tools.
|
|
16
|
+
- `uv run ruff check .` runs linting (strict rules configured in `pyproject.toml`).
|
|
17
|
+
- `uv run ruff format .` applies formatting (line length 140).
|
|
18
|
+
- `./scripts/test.sh` runs the full test suite with coverage and a configurable threshold.
|
|
19
|
+
- `uv run pytest tests/unit/` runs unit tests directly when you want faster feedback.
|
|
20
|
+
- `uv build` builds the package for distribution.
|
|
21
|
+
|
|
22
|
+
## Coding Style & Naming Conventions
|
|
23
|
+
|
|
24
|
+
- Python 3.11+ only, 4-space indentation.
|
|
25
|
+
- Keep type hints for function parameters and return values.
|
|
26
|
+
- Follow ruff defaults plus repository rules; avoid unused imports and keep lines under 140 characters.
|
|
27
|
+
- Names: `snake_case` for modules/functions, `PascalCase` for classes, `UPPER_SNAKE_CASE` for constants.
|
|
28
|
+
|
|
29
|
+
## Testing Guidelines
|
|
30
|
+
|
|
31
|
+
- Framework: `pytest` with `pytest-cov`.
|
|
32
|
+
- Naming patterns (from `pyproject.toml`): files `test_*.py` or `*_test.py`, classes `Test*`, functions `test_*`.
|
|
33
|
+
- Markers: `unit`, `integration`, `slow` (use `-m "not slow"` to skip).
|
|
34
|
+
- Coverage reports are generated in `htmlcov/` and `coverage.xml` via `scripts/test.sh`.
|
|
35
|
+
|
|
36
|
+
## Commit & Pull Request Guidelines
|
|
37
|
+
|
|
38
|
+
- Commit messages follow an emoji prefix plus Conventional Commit style. Example: `:sparkles: feat(version): add --no-recursive option to version command`.
|
|
39
|
+
- Release commits use `:bookmark: version: vX.Y.Z`.
|
|
40
|
+
- PRs should describe the change, list tests run, and link related issues. Include screenshots only for CLI output or documentation changes.
|
|
41
|
+
|
|
42
|
+
## Configuration & Secrets
|
|
43
|
+
|
|
44
|
+
- Local settings live in `.tgit.yaml` (workspace) or `~/.tgit.yaml` (global). Do not commit real API keys or tokens.
|
|
@@ -1,3 +1,51 @@
|
|
|
1
|
+
## v0.29.0
|
|
2
|
+
|
|
3
|
+
[v0.28.0...v0.29.0](https://github.com/Jannchie/tgit/compare/v0.28.0...v0.29.0)
|
|
4
|
+
|
|
5
|
+
### :sparkles: Features
|
|
6
|
+
|
|
7
|
+
- **commit**: prompt to stage all changes before commit - By [Jannchie](mailto:jannchie@gmail.com) in [199dbc2](https://github.com/Jannchie/tgit/commit/199dbc2)
|
|
8
|
+
|
|
9
|
+
### :wrench: Chores
|
|
10
|
+
|
|
11
|
+
- **tools**: add test and ci types, update prompts and model - By [Jannchie](mailto:jannchie@gmail.com) in [cca3d98](https://github.com/Jannchie/tgit/commit/cca3d98)
|
|
12
|
+
|
|
13
|
+
## v0.28.0
|
|
14
|
+
|
|
15
|
+
[v0.27.0...v0.28.0](https://github.com/Jannchie/tgit/compare/v0.27.0...v0.28.0)
|
|
16
|
+
|
|
17
|
+
### :sparkles: Features
|
|
18
|
+
|
|
19
|
+
- **version**: add --no-recursive option to version command - By [Jannchie](mailto:jannchie@gmail.com) in [de77df7](https://github.com/Jannchie/tgit/commit/de77df7)
|
|
20
|
+
|
|
21
|
+
### :memo: Documentation
|
|
22
|
+
|
|
23
|
+
- **contributing**: add repository guidelines document - By [Jannchie](mailto:jannchie@gmail.com) in [96dd706](https://github.com/Jannchie/tgit/commit/96dd706)
|
|
24
|
+
|
|
25
|
+
### :wrench: Chores
|
|
26
|
+
|
|
27
|
+
- update dependency lock file - By [Jannchie](mailto:jannchie@gmail.com) in [20eaaac](https://github.com/Jannchie/tgit/commit/20eaaac)
|
|
28
|
+
|
|
29
|
+
## v0.27.0
|
|
30
|
+
|
|
31
|
+
[v0.26.0...v0.27.0](https://github.com/Jannchie/tgit/compare/v0.26.0...v0.27.0)
|
|
32
|
+
|
|
33
|
+
### :sparkles: Features
|
|
34
|
+
|
|
35
|
+
- **secrets**: add two-level secret scanning and handling - By [Jannchie](mailto:jannchie@gmail.com) in [fd4d632](https://github.com/Jannchie/tgit/commit/fd4d632)
|
|
36
|
+
|
|
37
|
+
### :adhesive_bandage: Fixes
|
|
38
|
+
|
|
39
|
+
- **version**: fix typo: reclusive -> recursive - By [Jannchie](mailto:jannchie@gmail.com) in [37c88f5](https://github.com/Jannchie/tgit/commit/37c88f5)
|
|
40
|
+
|
|
41
|
+
### :art: Refactors
|
|
42
|
+
|
|
43
|
+
- **ai**: refactor ai commit generation flow - By [Jannchie](mailto:jannchie@gmail.com) in [dd3ac63](https://github.com/Jannchie/tgit/commit/dd3ac63)
|
|
44
|
+
|
|
45
|
+
### :memo: Documentation
|
|
46
|
+
|
|
47
|
+
- **readme**: mention secret scanning warnings - By [Jannchie](mailto:jannchie@gmail.com) in [10037b6](https://github.com/Jannchie/tgit/commit/10037b6)
|
|
48
|
+
|
|
1
49
|
## v0.26.0
|
|
2
50
|
|
|
3
51
|
[v0.25.0...v0.26.0](https://github.com/Jannchie/tgit/compare/v0.25.0...v0.26.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tgit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.29.0
|
|
4
4
|
Summary: Tool for Git Interaction Temptation (tgit): An elegant CLI tool that simplifies and streamlines your Git workflow, making version control a breeze.
|
|
5
5
|
Author-email: Jannchie <jannchie@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -41,6 +41,7 @@ An elegant CLI tool that simplifies and streamlines your Git workflow with AI-po
|
|
|
41
41
|
- Smart diff analysis that focuses on meaningful changes
|
|
42
42
|
- Support for custom commit types and emojis
|
|
43
43
|
- Breaking change detection
|
|
44
|
+
- Two-level secret scanning: prompts (default yes) for key names and blocking prompts for exposed values
|
|
44
45
|
|
|
45
46
|
### 📝 Automated Changelog
|
|
46
47
|
|
|
@@ -144,6 +145,9 @@ tgit changelog --to v2.0.0
|
|
|
144
145
|
# Interactive version bump
|
|
145
146
|
tgit version
|
|
146
147
|
|
|
148
|
+
# Limit to root only (disable recursive bump)
|
|
149
|
+
tgit version --no-recursive
|
|
150
|
+
|
|
147
151
|
# Bump specific version type
|
|
148
152
|
tgit version --patch
|
|
149
153
|
tgit version --minor
|
|
@@ -16,6 +16,7 @@ An elegant CLI tool that simplifies and streamlines your Git workflow with AI-po
|
|
|
16
16
|
- Smart diff analysis that focuses on meaningful changes
|
|
17
17
|
- Support for custom commit types and emojis
|
|
18
18
|
- Breaking change detection
|
|
19
|
+
- Two-level secret scanning: prompts (default yes) for key names and blocking prompts for exposed values
|
|
19
20
|
|
|
20
21
|
### 📝 Automated Changelog
|
|
21
22
|
|
|
@@ -119,6 +120,9 @@ tgit changelog --to v2.0.0
|
|
|
119
120
|
# Interactive version bump
|
|
120
121
|
tgit version
|
|
121
122
|
|
|
123
|
+
# Limit to root only (disable recursive bump)
|
|
124
|
+
tgit version --no-recursive
|
|
125
|
+
|
|
122
126
|
# Bump specific version type
|
|
123
127
|
tgit version --patch
|
|
124
128
|
tgit version --minor
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tgit"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.29.0"
|
|
4
4
|
description = "Tool for Git Interaction Temptation (tgit): An elegant CLI tool that simplifies and streamlines your Git workflow, making version control a breeze."
|
|
5
5
|
authors = [{ name = "Jannchie", email = "jannchie@gmail.com" }]
|
|
6
6
|
dependencies = [
|
|
@@ -112,6 +112,7 @@ exclude_lines = [
|
|
|
112
112
|
"if __name__ == .__main__.:",
|
|
113
113
|
"class .*\\bProtocol\\):",
|
|
114
114
|
"@(abc\\.)?abstractmethod",
|
|
115
|
+
"if TYPE_CHECKING:",
|
|
115
116
|
]
|
|
116
117
|
|
|
117
118
|
[dependency-groups]
|
|
@@ -127,7 +127,7 @@ dependencies = []
|
|
|
127
127
|
next_version = Version(major=1, minor=1, patch=0)
|
|
128
128
|
|
|
129
129
|
# Update version files
|
|
130
|
-
update_version_files(args, next_version, verbose=0,
|
|
130
|
+
update_version_files(args, next_version, verbose=0, recursive=False)
|
|
131
131
|
|
|
132
132
|
# Verify update
|
|
133
133
|
updated_content = json.loads(package_json.read_text())
|
|
@@ -171,7 +171,7 @@ description = "Test package"
|
|
|
171
171
|
next_version = Version(major=2, minor=0, patch=0)
|
|
172
172
|
|
|
173
173
|
# Update version files
|
|
174
|
-
update_version_files(args, next_version, verbose=0,
|
|
174
|
+
update_version_files(args, next_version, verbose=0, recursive=False)
|
|
175
175
|
|
|
176
176
|
# Verify update
|
|
177
177
|
updated_content = pyproject_toml.read_text()
|
|
@@ -208,7 +208,7 @@ description = "Test package"
|
|
|
208
208
|
next_version = Version(major=1, minor=0, patch=1)
|
|
209
209
|
|
|
210
210
|
# Update version files
|
|
211
|
-
update_version_files(args, next_version, verbose=0,
|
|
211
|
+
update_version_files(args, next_version, verbose=0, recursive=False)
|
|
212
212
|
|
|
213
213
|
# Verify updates
|
|
214
214
|
updated_package_json = json.loads(package_json.read_text())
|
|
@@ -251,7 +251,7 @@ description = "Test package"
|
|
|
251
251
|
next_version = Version(major=1, minor=1, patch=0)
|
|
252
252
|
|
|
253
253
|
# Update version files
|
|
254
|
-
update_version_files(args, next_version, verbose=0,
|
|
254
|
+
update_version_files(args, next_version, verbose=0, recursive=True)
|
|
255
255
|
|
|
256
256
|
# Verify updates in both directories
|
|
257
257
|
root_content = json.loads(root_package_json.read_text())
|
|
@@ -295,7 +295,7 @@ description = "Test package"
|
|
|
295
295
|
next_version = Version(major=2, minor=0, patch=0)
|
|
296
296
|
|
|
297
297
|
# Update version files
|
|
298
|
-
update_version_files(args, next_version, verbose=0,
|
|
298
|
+
update_version_files(args, next_version, verbose=0, recursive=True)
|
|
299
299
|
|
|
300
300
|
# Verify root package.json was updated
|
|
301
301
|
root_content = json.loads(root_package_json.read_text())
|
|
@@ -418,7 +418,7 @@ class TestVersionGitIntegration:
|
|
|
418
418
|
|
|
419
419
|
# Update version files
|
|
420
420
|
next_version = Version(major=1, minor=0, patch=1)
|
|
421
|
-
update_version_files(args, next_version, verbose=0,
|
|
421
|
+
update_version_files(args, next_version, verbose=0, recursive=False)
|
|
422
422
|
|
|
423
423
|
# Verify version was updated
|
|
424
424
|
updated_content = json.loads(package_json.read_text())
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from unittest.mock import Mock, patch
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from tgit.changelog import (
|
|
5
|
+
get_changelog_by_range,
|
|
6
|
+
get_commits,
|
|
7
|
+
prepare_changelog_segments,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TestChangelogCoverage:
|
|
12
|
+
"""Additional tests to increase coverage for changelog.py."""
|
|
13
|
+
|
|
14
|
+
@patch("tgit.changelog.commit_pattern")
|
|
15
|
+
def test_get_commits_bytes_message(self, mock_pattern):
|
|
16
|
+
"""Test get_commits with bytes message."""
|
|
17
|
+
repo = Mock()
|
|
18
|
+
commit = Mock()
|
|
19
|
+
commit.message = b"feat: bytes message"
|
|
20
|
+
repo.iter_commits.return_value = [commit]
|
|
21
|
+
|
|
22
|
+
mock_pattern.match.return_value = None # Just to avoid further processing
|
|
23
|
+
|
|
24
|
+
get_commits(repo, "HEAD~1", "HEAD")
|
|
25
|
+
|
|
26
|
+
# Verify message was decoded
|
|
27
|
+
# Since we mocked match to return None, we can't verify the result list,
|
|
28
|
+
# but we can verify that no error occurred during decoding.
|
|
29
|
+
|
|
30
|
+
@patch("tgit.changelog.commit_pattern")
|
|
31
|
+
def test_get_commits_non_string_message(self, mock_pattern):
|
|
32
|
+
"""Test get_commits with non-string message."""
|
|
33
|
+
repo = Mock()
|
|
34
|
+
commit = Mock()
|
|
35
|
+
commit.message = 12345
|
|
36
|
+
repo.iter_commits.return_value = [commit]
|
|
37
|
+
|
|
38
|
+
mock_pattern.match.return_value = None
|
|
39
|
+
|
|
40
|
+
get_commits(repo, "HEAD~1", "HEAD")
|
|
41
|
+
|
|
42
|
+
def test_prepare_changelog_segments_with_latest_tag_in_file(self):
|
|
43
|
+
"""Test prepare_changelog_segments with latest_tag_in_file."""
|
|
44
|
+
repo = Mock()
|
|
45
|
+
tag1 = Mock()
|
|
46
|
+
tag1.name = "v1.0.0"
|
|
47
|
+
tag1.commit.hexsha = "hash1"
|
|
48
|
+
tag1.commit.committed_datetime = 1000
|
|
49
|
+
|
|
50
|
+
tag2 = Mock()
|
|
51
|
+
tag2.name = "v1.1.0"
|
|
52
|
+
tag2.commit.hexsha = "hash2"
|
|
53
|
+
tag2.commit.committed_datetime = 2000
|
|
54
|
+
|
|
55
|
+
repo.tags = [tag1, tag2]
|
|
56
|
+
repo.iter_commits.return_value = [Mock(hexsha="init")]
|
|
57
|
+
|
|
58
|
+
# Mock get_first_commit_hash
|
|
59
|
+
with patch("tgit.changelog.get_first_commit_hash", return_value="init"):
|
|
60
|
+
segments = prepare_changelog_segments(repo, latest_tag_in_file="v1.0.0")
|
|
61
|
+
|
|
62
|
+
assert len(segments) == 1
|
|
63
|
+
assert segments[0].from_name == "v1.0.0"
|
|
64
|
+
assert segments[0].to_name == "v1.1.0"
|
|
65
|
+
|
|
66
|
+
@patch("tgit.changelog.get_commits")
|
|
67
|
+
@patch("tgit.changelog.group_commits_by_type")
|
|
68
|
+
@patch("tgit.changelog.generate_changelog")
|
|
69
|
+
def test_get_changelog_by_range_no_remote(self, mock_gen, mock_group, mock_get_commits):
|
|
70
|
+
"""Test get_changelog_by_range when remote is missing."""
|
|
71
|
+
repo = Mock()
|
|
72
|
+
repo.remote.side_effect = ValueError("No remote")
|
|
73
|
+
|
|
74
|
+
with pytest.warns(UserWarning, match="Origin not found"):
|
|
75
|
+
get_changelog_by_range(repo, "HEAD~1", "HEAD")
|
|
76
|
+
|
|
77
|
+
mock_gen.assert_called_once()
|
|
78
|
+
assert mock_gen.call_args[0][3] is None # remote_uri should be None
|