gitpr-cli 0.0.31__tar.gz → 0.0.32__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.
- {gitpr_cli-0.0.31/gitpr_cli.egg-info → gitpr_cli-0.0.32}/PKG-INFO +46 -1
- gitpr_cli-0.0.31/PKG-INFO → gitpr_cli-0.0.32/README.md +402 -376
- gitpr_cli-0.0.31/README.md → gitpr_cli-0.0.32/gitpr_cli.egg-info/PKG-INFO +421 -357
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/SOURCES.txt +2 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/pyproject.toml +11 -2
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/blame_engine.py +5 -1
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/core.py +309 -22
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/i18n.py +10 -10
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/linter_engine.py +3 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/main.py +14 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/updater.py +7 -2
- gitpr_cli-0.0.32/tests/test_blame_metrics.py +140 -0
- gitpr_cli-0.0.32/tests/test_linter_metrics.py +116 -0
- gitpr_cli-0.0.32/tests/test_smart_excludes.py +234 -0
- gitpr_cli-0.0.31/tests/test_smart_excludes.py +0 -71
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/LICENSE +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/dependency_links.txt +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/entry_points.txt +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/requires.txt +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/gitpr_cli.egg-info/top_level.txt +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/setup.cfg +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/__init__.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/ai_providers.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/cache.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/chat_memory.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/config.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/issue_engine.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/mcp_server.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/metrics.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/security.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/spinner.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/tui_issue.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/ui/__init__.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/ui/chat_app.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/ui/help_screen.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/ui/issue_app.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/src/ui/metrics_app.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/tests/test_chat_backend.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/tests/test_core.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/tests/test_install_wizard.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/tests/test_mcp_prompts.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/tests/test_mcp_server.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/tests/test_metrics.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/tests/test_pre_save.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/tests/test_skill_command.py +0 -0
- {gitpr_cli-0.0.31 → gitpr_cli-0.0.32}/tests/test_thinking_words.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitpr-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.32
|
|
4
4
|
Summary: AI-powered PR automation, commit messages, and code review (Gemini, DeepSeek, and Ollama)
|
|
5
5
|
Author-email: Natan Fiuza <contato@natanfiuza.dev.br>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -238,6 +238,32 @@ To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.g
|
|
|
238
238
|
|
|
239
239
|
> 📖 **Full developer guide:** [docs/i18n_explanation.md](https://github.com/natanfiuza/gitpr/blob/main/docs/i18n_explanation.md) — architecture, usage patterns, circular import precautions, and how to add new languages.
|
|
240
240
|
|
|
241
|
+
## 🔄 Hook Scripts Versioning & Auto-Sync
|
|
242
|
+
|
|
243
|
+
GitPR includes an automatic versioning system for Git hook scripts (`pre-commit`, `prepare-commit-msg`, `pre-push`, `post-checkout`, `post-merge`). Every time you run `gitpr`, the system silently checks whether your installed hooks match the latest version and automatically updates them if needed — all while respecting your language preference.
|
|
244
|
+
|
|
245
|
+
**How it works:**
|
|
246
|
+
1. Reads `SCRIPTS_VERSION` and `SCRIPTS_LANG` from `~/.gitpr/.env`
|
|
247
|
+
2. Compares with the latest version (`__scripts_version__`) shipped with your GitPR release
|
|
248
|
+
3. If versions or language differ → automatically downloads and updates hooks
|
|
249
|
+
4. If everything matches → skips entirely (single `.env` read, zero network I/O)
|
|
250
|
+
|
|
251
|
+
**Example:**
|
|
252
|
+
```bash
|
|
253
|
+
# First run — no hooks installed yet
|
|
254
|
+
$ gitpr --installhooks
|
|
255
|
+
📥 Downloading pre-commit...
|
|
256
|
+
📥 Downloading prepare-commit-msg...
|
|
257
|
+
✅ Scripts synced successfully!
|
|
258
|
+
|
|
259
|
+
# Subsequent runs — silent checks
|
|
260
|
+
$ gitpr # (no output = hooks are up to date)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
The system supports **5 languages**: English (default), Portuguese (Brazil), Portuguese (Portugal), French, and Spanish. Scripts are thin shims — the real logic lives in the CLI, so even slightly stale hooks continue working correctly.
|
|
264
|
+
|
|
265
|
+
📚 [Full Documentation](https://gitpr.natanfiuza.dev.br/docs/hooks-versioning)
|
|
266
|
+
|
|
241
267
|
## 🔌 MCP Integration (Model Context Protocol)
|
|
242
268
|
|
|
243
269
|
GitPR can run as an **MCP server**, exposing its AI-powered capabilities as tools that your editor's AI assistant can invoke directly — no terminal needed. This enables a fully integrated workflow where you can generate commit messages, review code, run linters, trace code origins, and create issues without leaving your IDE.
|
|
@@ -297,6 +323,24 @@ Once configured, use natural language in your editor's AI chat:
|
|
|
297
323
|
|
|
298
324
|
> 💬 **MCP Prompts** — GitPR also exposes 7 pre-defined message templates (prompts) for common flows like "Review PR", "Generate Commit Message", and "Create Issue from Diff". See the [MCP Prompts guide](https://github.com/natanfiuza/gitpr/blob/main/docs/mcp-prompts.md) for the full list.
|
|
299
325
|
|
|
326
|
+
## 🎯 Smart Excludes (Token Optimization)
|
|
327
|
+
|
|
328
|
+
GitPR automatically removes non-code files from your `git diff` before sending them to the AI — reducing token consumption and API costs with **zero configuration** required.
|
|
329
|
+
|
|
330
|
+
**Two layers of exclusions:**
|
|
331
|
+
- **Lockfiles & generated files:** `package-lock.json`, `*.min.js`, `*.map`, `*.pyc`, `*.svg`, and 30+ more patterns defined in [`gitpr.smart-excludes.json`](https://github.com/natanfiuza/gitpr/blob/main/templates/gitpr.smart-excludes.json)
|
|
332
|
+
- **Documentation prose:** `*.md`, `*.txt`, `*.rst`, `*.adoc`, `*.tex`, and 20+ more extensions defined in [`gitpr.docs-smart-excludes.json`](https://github.com/natanfiuza/gitpr/blob/main/templates/gitpr.docs-smart-excludes.json)
|
|
333
|
+
|
|
334
|
+
**Documentation tracking:** Even though documentation content is excluded from the diff, GitPR still tells the AI _which_ documentation files changed by injecting their paths as metadata into the system instructions. The AI has full context about doc updates without consuming tokens on their prose.
|
|
335
|
+
|
|
336
|
+
**Benefits:**
|
|
337
|
+
- ✅ Up to **98% token reduction** on documentation-heavy branches
|
|
338
|
+
- ✅ **Faster AI responses** — less text to process per API call
|
|
339
|
+
- ✅ **Higher-quality analysis** — AI focuses on code changes, not markup
|
|
340
|
+
- ✅ **Zero configuration** — works automatically on every run, managed remotely
|
|
341
|
+
|
|
342
|
+
> 📖 **Full documentation:** [docs/smart-excludes.md](https://github.com/natanfiuza/gitpr/blob/main/docs/smart-excludes.md) — available in 5 languages (EN, PT-BR, PT-PT, FR, ES).
|
|
343
|
+
|
|
300
344
|
## 📚 Technical Documentation and Advanced Guides
|
|
301
345
|
|
|
302
346
|
To keep this README concise, we detail the most advanced **DevOps** and **Continuous Integration** focused implementations in separate documents.
|
|
@@ -312,6 +356,7 @@ If you want to implement GitPR as an automated quality barrier in your team, che
|
|
|
312
356
|
### DevOps & CI/CD
|
|
313
357
|
|
|
314
358
|
* [**Local Git Hooks (Shift-Left)**](https://github.com/natanfiuza/gitpr/blob/main/docs/git-hooks-locais.md) — How to use `gitpr --installhooks` to create guardrails on the developer's machine and use AI to automatically write commit messages.
|
|
359
|
+
* [**Hook Scripts Versioning & Auto-Sync**](https://github.com/natanfiuza/gitpr/blob/main/docs/hooks-versioning.md) — How the automatic versioning and i18n-aware synchronization system keeps your Git hooks up to date.
|
|
315
360
|
* [**Customizable Static Linter**](https://github.com/natanfiuza/gitpr/blob/main/docs/linter-regras-customizadas.md) — How to create validation rules in `.gitpr.linter.yml` for CI/CD and pre-commit hooks.
|
|
316
361
|
* [**CI/CD Integration (GitHub Actions)**](https://github.com/natanfiuza/gitpr/blob/main/docs/github-ci-linter.md) — How to run GitPR in the pipeline to block "Merge" of PRs with violations.
|
|
317
362
|
|