gitpr-cli 1.4.1__py3-none-any.whl → 1.4.2__py3-none-any.whl
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-1.4.1.dist-info → gitpr_cli-1.4.2.dist-info}/METADATA +73 -73
- {gitpr_cli-1.4.1.dist-info → gitpr_cli-1.4.2.dist-info}/RECORD +14 -14
- {gitpr_cli-1.4.1.dist-info → gitpr_cli-1.4.2.dist-info}/WHEEL +1 -1
- src/application/use_cases/generate_pr_explanation.py +13 -4
- src/application/use_cases/generate_test_file.py +28 -8
- src/cache.py +12 -2
- src/core.py +11 -0
- src/domain/pr/explain_section_builder.py +55 -26
- src/issue_engine.py +6 -1
- src/main.py +36 -10
- src/updater.py +1 -1
- {gitpr_cli-1.4.1.dist-info → gitpr_cli-1.4.2.dist-info}/entry_points.txt +0 -0
- {gitpr_cli-1.4.1.dist-info → gitpr_cli-1.4.2.dist-info}/licenses/LICENSE +0 -0
- {gitpr_cli-1.4.1.dist-info → gitpr_cli-1.4.2.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitpr-cli
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.2
|
|
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
|
|
@@ -54,7 +54,7 @@ gitpr demo
|
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
> **Guided Tour:** Six screens walking through a real example — the diff, the commit message, the code review and the pull request description — with the answers recorded once and replayed. Add `--no-tui` for plain text, `--scenario security-issue` for the other example.
|
|
57
|
-
> 📖 **Full Documentation:** [https://gitpr.natanfiuza.dev.br/docs/demo
|
|
57
|
+
> 📖 **Full Documentation:** [https://gitpr.natanfiuza.dev.br/docs/demo](https://gitpr.natanfiuza.dev.br/docs/demo)
|
|
58
58
|
|
|
59
59
|
### **3. Initializing in a Repository**
|
|
60
60
|
|
|
@@ -65,7 +65,7 @@ gitpr --install
|
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
> **Guided Setup:** Guided configuration that downloads skill templates, installs Git Hooks, configures MCP for your editors, and verifies the API key for your AI provider.
|
|
68
|
-
> 📖 **Full Documentation:** [https://gitpr.natanfiuza.dev.br/docs/install-wizard
|
|
68
|
+
> 📖 **Full Documentation:** [https://gitpr.natanfiuza.dev.br/docs/install-wizard](https://gitpr.natanfiuza.dev.br/docs/install-wizard)
|
|
69
69
|
|
|
70
70
|
## **🛠️ Technologies and Libraries Used**
|
|
71
71
|
|
|
@@ -123,7 +123,7 @@ Pytest will automatically detect files inside the `tests/` folder and display a
|
|
|
123
123
|
```
|
|
124
124
|
*Note: Your configuration will be securely saved in the `~/.gitpr/.env` file.*
|
|
125
125
|
|
|
126
|
-
*Note (updates): GitPR is distributed exclusively through PyPI. On every run it checks whether a newer version has been published, and when one exists it **blocks the execution** and asks you to run `pip install --upgrade gitpr-cli`. See [auto-update
|
|
126
|
+
*Note (updates): GitPR is distributed exclusively through PyPI. On every run it checks whether a newer version has been published, and when one exists it **blocks the execution** and asks you to run `pip install --upgrade gitpr-cli`. See [gitpr.natanfiuza.dev.br/docs/auto-update](https://gitpr.natanfiuza.dev.br/docs/auto-update).*
|
|
127
127
|
|
|
128
128
|
> **🔒 Security Note:** GitPR CLI uses symmetric encryption (Fernet). Your API key is stored as a hash in the `.env` file, and the master key for decryption is automatically generated in `~/.gitpr/secret.key`. **Never share your secret.key file.**
|
|
129
129
|
|
|
@@ -157,20 +157,20 @@ The tool will sync with the remote (`git fetch`), compare your changes with the
|
|
|
157
157
|
### **Advanced Options and Commands**
|
|
158
158
|
You can pass the following *flags* for specific actions:
|
|
159
159
|
|
|
160
|
-
* `gitpr demo`: **Guided tour** over an example diff that ships with the tool — the commit message, the code review and the pull request description, produced by the real pipeline on a recorded example. Needs no API key, no Git repository and no connection, which makes it the first thing to run on a new machine. Use `--scenario <name>` for another example, `--lang <code>` for another language, `--no-tui` for plain text. 📖 [Full docs](https://
|
|
161
|
-
* `gitpr badge`: **Adoption badge for your README.** Prints the Markdown snippet — `--readme` prints only the line, `--style` picks the shields.io style (`flat`, `flat-square`, `for-the-badge`). Nothing is written to your README. Published pull requests carry a badge of their own, with the linter counts of the diff; `GITPR_BADGE=false` turns it off. 📖 [Full docs](https://
|
|
162
|
-
* `gitpr config`: **Interactive configuration screen.** Opens a master-detail TUI to view, edit, search, and validate all settings stored in `~/.gitpr/.env` (with secret encryption and live validation). 📖 [Full docs](https://
|
|
163
|
-
* `gitpr release`: **Changelog and Release Notes generator.** Scans commits since the previous version, categorizes them according to Conventional Commits, suggests a semantic version bump, generates an AI executive summary, and optionally publishes the release to your forge. 📖 [Full docs](https://
|
|
164
|
-
* `gitpr fix [<finding_id>]`: **Review findings patch application & rollback.** Turns findings from the last code review (`gitpr -r`) into safe, reviewable unified diffs. Includes safety classification (`safe`, `review_required`, `experimental`), `--all-safe` batching, `--force` validation, and `--rollback <patch-id>`. 📖 [Full docs](https://
|
|
165
|
-
* `gitpr split`: **Atomic commit splitter.** Reads uncommitted working tree changes, groups hunks by intent using AI, and proposes ordered atomic commits without altering your working tree files (`--dry-run`, `--apply`). 📖 [Full docs](https://
|
|
166
|
-
* `gitpr tests generate`: **AI test suite generation & scaffolding.** Analyzes your diff, a target file (`--file`), or a review finding (`--finding`) and generates complete, executable test suites (supporting pytest, jest, vitest, phpunit, pest). Use `--apply` to write to disk.
|
|
167
|
-
* `gitpr mentor [<finding_id>]`: **Junior Mentor Pedagogical Explanations.** Breaks down code review findings with educational context ("why this matters", real-world analogy, guided questions, and key takeaway) to foster growth and mentor developers. Works standalone over the latest review findings or with `--finding <id>`. 📖 [Full docs](https://
|
|
168
|
-
* `gitpr explain`: **Reviewer Guide generator.** Generates a concise summary explaining what changed, why it changed, where reviewers should focus, and potential regression risks. 📖 [Full docs](https://
|
|
169
|
-
* `gitpr review-pr <pr_number>`: **Remote Pull Request review.** Fetches and reviews an open pull request directly from the forge (GitHub, GitLab, Bitbucket, Azure DevOps) without checking out the branch locally. Use `--post-comment` to post the review directly to the PR. 📖 [Full docs](https://
|
|
170
|
-
* `gitpr risk`: **Local Risk Scoring for Diffs.** Computes a deterministic, explainable risk score (0.0 to 100.0) and badge (`LOW 🟢`, `MEDIUM 🟡`, `HIGH 🟠`, `CRITICAL 🔴`) using local repository signals (critical paths, missing tests, migrations, bug history, and static findings). Use `--file <path>`, `--format json`, `--base <ref>`, or `--no-history`. Automatically included in code reviews (`GITPR_RISK_INCLUDE_IN_REVIEW=true`). 📖 [Full docs](https://
|
|
171
|
-
* `gitpr policy`: **Shared quality policy for the repository.** Adopts a versioned YAML **Policy Pack** — review skills, linter rules, severity overrides, critical paths, risk weights and PR/commit conventions — and records the choice in `.gitpr/policy.lock.yml`, so the review, the linter and the risk score all run under the same policy, with a checksum per pack. `list`, `validate`, `show`, `use`, `init`, `install`, `off`. 📖 [Full docs](https://
|
|
172
|
-
* `gitpr baseline`: **Baseline and auditable suppressions for legacy adoption.** Records the findings a repository already has in `.gitpr/baseline.json`, so a run classifies every finding as `new`, `existing`, `resolved`, `ignored` or `accepted_debt` and **only `new` blocks**. Every suppression carries a reason, and accepted debt carries an owner and an optional deadline. `create`, `show`, `validate`, `update`, `suppress`, `unsuppress`. 📖 [Full docs](https://
|
|
173
|
-
* `gitpr check`: **Unified CI check command.** Consolidates static linter, secret scanning, external bridges (Semgrep, Gitleaks, Bandit), optional AI code review, risk scoring, and baseline into a single CI pipeline command. Emits machine-readable artifacts in **SARIF 2.1.0**, **JSON**, or **JUnit XML** with deterministic exit codes (`0`, `1`, `2`). 📖 [Full docs](https://
|
|
160
|
+
* `gitpr demo`: **Guided tour** over an example diff that ships with the tool — the commit message, the code review and the pull request description, produced by the real pipeline on a recorded example. Needs no API key, no Git repository and no connection, which makes it the first thing to run on a new machine. Use `--scenario <name>` for another example, `--lang <code>` for another language, `--no-tui` for plain text. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/demo)
|
|
161
|
+
* `gitpr badge`: **Adoption badge for your README.** Prints the Markdown snippet — `--readme` prints only the line, `--style` picks the shields.io style (`flat`, `flat-square`, `for-the-badge`). Nothing is written to your README. Published pull requests carry a badge of their own, with the linter counts of the diff; `GITPR_BADGE=false` turns it off. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/badge)
|
|
162
|
+
* `gitpr config`: **Interactive configuration screen.** Opens a master-detail TUI to view, edit, search, and validate all settings stored in `~/.gitpr/.env` (with secret encryption and live validation). 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/config-tui)
|
|
163
|
+
* `gitpr release`: **Changelog and Release Notes generator.** Scans commits since the previous version, categorizes them according to Conventional Commits, suggests a semantic version bump, generates an AI executive summary, and optionally publishes the release to your forge. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/release-notes)
|
|
164
|
+
* `gitpr fix [<finding_id>]`: **Review findings patch application & rollback.** Turns findings from the last code review (`gitpr -r`) into safe, reviewable unified diffs. Includes safety classification (`safe`, `review_required`, `experimental`), `--all-safe` batching, `--force` validation, and `--rollback <patch-id>`. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/fix-command)
|
|
165
|
+
* `gitpr split`: **Atomic commit splitter.** Reads uncommitted working tree changes, groups hunks by intent using AI, and proposes ordered atomic commits without altering your working tree files (`--dry-run`, `--apply`). 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/split-command)
|
|
166
|
+
* `gitpr tests generate`: **AI test suite generation & scaffolding.** Analyzes your diff, a target file (`--file`), or a review finding (`--finding`) and generates complete, executable test suites (supporting pytest, jest, vitest, phpunit, pest). Use `--apply` to write to disk. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/tests-generate)
|
|
167
|
+
* `gitpr mentor [<finding_id>]`: **Junior Mentor Pedagogical Explanations.** Breaks down code review findings with educational context ("why this matters", real-world analogy, guided questions, and key takeaway) to foster growth and mentor developers. Works standalone over the latest review findings or with `--finding <id>`. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/mentor-mode)
|
|
168
|
+
* `gitpr explain`: **Reviewer Guide generator.** Generates a concise summary explaining what changed, why it changed, where reviewers should focus, and potential regression risks. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/explain-pr)
|
|
169
|
+
* `gitpr review-pr <pr_number>`: **Remote Pull Request review.** Fetches and reviews an open pull request directly from the forge (GitHub, GitLab, Bitbucket, Azure DevOps) without checking out the branch locally. Use `--post-comment` to post the review directly to the PR. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/review-pr)
|
|
170
|
+
* `gitpr risk`: **Local Risk Scoring for Diffs.** Computes a deterministic, explainable risk score (0.0 to 100.0) and badge (`LOW 🟢`, `MEDIUM 🟡`, `HIGH 🟠`, `CRITICAL 🔴`) using local repository signals (critical paths, missing tests, migrations, bug history, and static findings). Use `--file <path>`, `--format json`, `--base <ref>`, or `--no-history`. Automatically included in code reviews (`GITPR_RISK_INCLUDE_IN_REVIEW=true`). 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/risk-scoring)
|
|
171
|
+
* `gitpr policy`: **Shared quality policy for the repository.** Adopts a versioned YAML **Policy Pack** — review skills, linter rules, severity overrides, critical paths, risk weights and PR/commit conventions — and records the choice in `.gitpr/policy.lock.yml`, so the review, the linter and the risk score all run under the same policy, with a checksum per pack. `list`, `validate`, `show`, `use`, `init`, `install`, `off`. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/policy-packs)
|
|
172
|
+
* `gitpr baseline`: **Baseline and auditable suppressions for legacy adoption.** Records the findings a repository already has in `.gitpr/baseline.json`, so a run classifies every finding as `new`, `existing`, `resolved`, `ignored` or `accepted_debt` and **only `new` blocks**. Every suppression carries a reason, and accepted debt carries an owner and an optional deadline. `create`, `show`, `validate`, `update`, `suppress`, `unsuppress`. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/baseline-suppressions)
|
|
173
|
+
* `gitpr check`: **Unified CI check command.** Consolidates static linter, secret scanning, external bridges (Semgrep, Gitleaks, Bandit), optional AI code review, risk scoring, and baseline into a single CI pipeline command. Emits machine-readable artifacts in **SARIF 2.1.0**, **JSON**, or **JUnit XML** with deterministic exit codes (`0`, `1`, `2`). 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/check-ci)
|
|
174
174
|
* `-c` or `--commit`: Runs a local `git diff` and displays **only the suggested commit message**.
|
|
175
175
|
* `-r` or `--review`: Performs a detailed **Code Review** of local changes. Use with `--mentor` to append pedagogical mentoring explanations for each finding.
|
|
176
176
|
* `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch. Use with `--mentor` to append pedagogical mentoring explanations.
|
|
@@ -179,14 +179,14 @@ You can pass the following *flags* for specific actions:
|
|
|
179
179
|
* `--lang <code>`: Forces the interface language for this execution (e.g.: `en_us`, `pt_br`). Overrides `GITPR_LANG` in `.env` without persisting the change.
|
|
180
180
|
* `-ch` or `--chat`: Opens the **Interactive Pair Programming Chat** — a TUI terminal where the AI sees your current diff and maintains a contextual conversation. Features memory per branch, slash commands (`/explain`, `/tests`, `/optimize`, `/clear`), auto-patching (F5), diff refresh (F2), and session export (F6).
|
|
181
181
|
* `-l` or `--linter`: Runs **only the local static linter** (no AI calls). Ideal for use in CI/CD pipelines to block non-compliant code.
|
|
182
|
-
* `--status`: Lists uncommitted file changes categorized as **new**, **modified**, and **deleted** — fast, no AI, no network. 📖 [Full docs](https://
|
|
183
|
-
* `--no-unstaged-check`: Skips the unstaged files verification before AI processing for a single invocation. Equivalent to `GITPR_SKIP_UNSTAGED_CHECK=true` for one run. 📖 [Full docs](https://
|
|
184
|
-
* `--no-suggest-reviewers`: Disables the suggested reviewers computation in the interactive PR publisher (default ON). 📖 [Full docs](https://
|
|
185
|
-
* `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description.
|
|
186
|
-
* `--init`: **Interactive SCM forge wizard.** Detects the repository's forge (GitHub, GitLab, Bitbucket Cloud, Azure DevOps), configures the provider, and stores the access token encrypted. 📖 [Full docs](https://
|
|
187
|
-
* `--linter-setup`: **Interactive external linter wizard.** Guides you through installing and configuring external linters (ESLint, PHPCS, Stylelint) as a Checkstyle XML bridge. 📖 [Full docs](https://
|
|
182
|
+
* `--status`: Lists uncommitted file changes categorized as **new**, **modified**, and **deleted** — fast, no AI, no network. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/git-status)
|
|
183
|
+
* `--no-unstaged-check`: Skips the unstaged files verification before AI processing for a single invocation. Equivalent to `GITPR_SKIP_UNSTAGED_CHECK=true` for one run. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/git-status)
|
|
184
|
+
* `--no-suggest-reviewers`: Disables the suggested reviewers computation in the interactive PR publisher (default ON). 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/suggested-reviewers)
|
|
185
|
+
* `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/explain-pr)
|
|
186
|
+
* `--init`: **Interactive SCM forge wizard.** Detects the repository's forge (GitHub, GitLab, Bitbucket Cloud, Azure DevOps), configures the provider, and stores the access token encrypted. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/scm-multiforge)
|
|
187
|
+
* `--linter-setup`: **Interactive external linter wizard.** Guides you through installing and configuring external linters (ESLint, PHPCS, Stylelint) as a Checkstyle XML bridge. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/linter-regras-customizadas)
|
|
188
188
|
* `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as 16 annotated tools, 19 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
|
|
189
|
-
* `--plugins`: Lists all **globally installed plugins** — custom linter packs from `~/.gitpr/plugins/linter/` and MCP prompt templates from `~/.gitpr/plugins/prompts/`. These plugins apply across all your projects without duplication. 📖 [Full docs](https://
|
|
189
|
+
* `--plugins`: Lists all **globally installed plugins** — custom linter packs from `~/.gitpr/plugins/linter/` and MCP prompt templates from `~/.gitpr/plugins/prompts/`. These plugins apply across all your projects without duplication. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/plugins-system)
|
|
190
190
|
* `--install`: **Interactive Setup Wizard.** Runs a guided 4-step setup: downloads skill templates, installs Git hooks, configures MCP for detected editors, and checks/requests your AI provider API key. Each step asks for confirmation before proceeding.
|
|
191
191
|
* `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
|
|
192
192
|
* `-s` or `--skill`: Creates the AI context template files (`.gitpr.commit.md`, `.gitpr.pr.md`, `.gitpr.review.md`, `.gitpr.filereview.md`, `.gitpr.issue.md`, `.gitpr.blame.md`) and the Linter (`.gitpr.linter.yml`) inside `.gitpr/skill/`.
|
|
@@ -194,7 +194,7 @@ You can pass the following *flags* for specific actions:
|
|
|
194
194
|
* **New Code Issue (`gitpr -is`):** Reads the current `git diff`. **Why use:** Ideal for quickly documenting the task you just finished programming, before committing.
|
|
195
195
|
* **Epic/Release Issue (`gitpr -is -ht`):** Reads the full history of the current branch (Git Log + PR Cache). **Why use:** Ideal for generating consolidated documentation of an entire release or a large *feature* that took several days/commits to complete.
|
|
196
196
|
* **Archaeological/Technical Debt Issue (`gitpr -is -b file:lines`):** Reads the timeline of a specific business rule. **Why use:** Ideal for documenting technical debt, explaining how a legacy code block evolved and why it needs to be refactored.
|
|
197
|
-
* **PR Publisher (default):** Running `gitpr` generates the PR description with AI, saves the `.md` file to `.gitpr/reports/pr_desc/`, and opens an interactive terminal interface (TUI) to review, edit, and publish the Pull Request directly to GitHub, GitLab, Bitbucket, or Azure DevOps via REST API. Before generation, it checks for unstaged files, calculates suggested reviewers, and offers a modal to manage them. Use `--no-publish` to save only the PR file locally without opening the publisher, or `--no-edit` to auto-commit pending changes (with lint validation), auto-push, and publish immediately — handling existing PR updates, optional auto-merge, and clear error feedback when merge conflicts occur. Use `--base <branch>` to change the target branch. 📖 [Full docs](https://
|
|
197
|
+
* **PR Publisher (default):** Running `gitpr` generates the PR description with AI, saves the `.md` file to `.gitpr/reports/pr_desc/`, and opens an interactive terminal interface (TUI) to review, edit, and publish the Pull Request directly to GitHub, GitLab, Bitbucket, or Azure DevOps via REST API. Before generation, it checks for unstaged files, calculates suggested reviewers, and offers a modal to manage them. Use `--no-publish` to save only the PR file locally without opening the publisher, or `--no-edit` to auto-commit pending changes (with lint validation), auto-push, and publish immediately — handling existing PR updates, optional auto-merge, and clear error feedback when merge conflicts occur. Use `--base <branch>` to change the target branch. 📖 [Full docs](https://gitpr.natanfiuza.dev.br/docs/pull-request-publication)
|
|
198
198
|
* `-h` or `--help`: Shows the general help with all options. Use together with another flag for **contextual help** (e.g.: `gitpr -h --issue`, `gitpr -h --linter`) with a direct link to the detailed documentation of each feature.
|
|
199
199
|
* `-u` or `--update`: Checks the latest version of GitPR on PyPI and shows how to update it (Auto-Updater).
|
|
200
200
|
|
|
@@ -206,7 +206,7 @@ You can pass the following *flags* for specific actions:
|
|
|
206
206
|
|
|
207
207
|
When your diff is too large for a single AI call (over ~90k estimated tokens), GitPR automatically splits it into batches by file, asks the AI for a technical summary of each part (Map), and unifies everything into the final commit message, review, or PR description (Reduce). No flags needed — it activates on demand and shows the progress in the console.
|
|
208
208
|
|
|
209
|
-
📚 Full documentation: [docs/map-reduce-diff
|
|
209
|
+
📚 Full documentation: [gitpr.natanfiuza.dev.br/docs/map-reduce-diff](https://gitpr.natanfiuza.dev.br/docs/map-reduce-diff)
|
|
210
210
|
|
|
211
211
|
## 🛡️ Local Linter (Static Analysis & Security)
|
|
212
212
|
|
|
@@ -281,7 +281,7 @@ gitpr risk --format json # Output JSON for CI/CD pipelines
|
|
|
281
281
|
gitpr risk --base main # Evaluate against specific git base ref
|
|
282
282
|
```
|
|
283
283
|
|
|
284
|
-
📖 **Full documentation:** [docs/risk-scoring
|
|
284
|
+
📖 **Full documentation:** [gitpr.natanfiuza.dev.br/docs/risk-scoring](https://gitpr.natanfiuza.dev.br/docs/risk-scoring)
|
|
285
285
|
|
|
286
286
|
## 🧾 Adopting GitPR in a Legacy Repository (gitpr baseline)
|
|
287
287
|
|
|
@@ -309,7 +309,7 @@ Four variables in `~/.gitpr/.env`, also editable through `gitpr config` in the s
|
|
|
309
309
|
|
|
310
310
|
Only a `new` error-level finding exits non-zero, and only `new` findings carry risk points — everything else reaches the risk report as zero-point evidence with its status. The baseline is never sent to the AI, and no entry stores code or a secret: the file is committed, so only a digest of the offending line is kept.
|
|
311
311
|
|
|
312
|
-
📖 **Full documentation:** [docs/baseline-suppressions
|
|
312
|
+
📖 **Full documentation:** [gitpr.natanfiuza.dev.br/docs/baseline-suppressions](https://gitpr.natanfiuza.dev.br/docs/baseline-suppressions)
|
|
313
313
|
|
|
314
314
|
## 🤝 Co-Author Signature
|
|
315
315
|
|
|
@@ -321,7 +321,7 @@ Co-Authored-By: Gitpr-cli <gitpr@natanfiuza.dev.br>
|
|
|
321
321
|
|
|
322
322
|
The trailer is appended programmatically (never by the AI) in all flows: console suggestion (`gitpr -c`), the `prepare-commit-msg` hook, auto-commit (`--no-edit`), the PR publication TUI, and the MCP `generate_commit_message` tool. It is idempotent — never duplicated when the message already contains it — and is hidden from the TUI edit screen, injected only when the commit is executed.
|
|
323
323
|
|
|
324
|
-
📖 **Full documentation:** [docs/commit-message-ia
|
|
324
|
+
📖 **Full documentation:** [gitpr.natanfiuza.dev.br/docs/commit-message-ia](https://gitpr.natanfiuza.dev.br/docs/commit-message-ia)
|
|
325
325
|
|
|
326
326
|
## 🏷️ Pull Request Badge
|
|
327
327
|
|
|
@@ -337,7 +337,7 @@ For your own README there is a static badge. `gitpr badge --readme` prints the l
|
|
|
337
337
|
|
|
338
338
|
[](https://gitpr.natanfiuza.dev.br/)
|
|
339
339
|
|
|
340
|
-
📖 **Full documentation:** [docs/badge
|
|
340
|
+
📖 **Full documentation:** [gitpr.natanfiuza.dev.br/docs/badge](https://gitpr.natanfiuza.dev.br/docs/badge)
|
|
341
341
|
|
|
342
342
|
## 🧠 Multi-Model Architecture (AI-Agnostic)
|
|
343
343
|
|
|
@@ -373,7 +373,7 @@ GitPR automatically detects your system language and displays messages in your n
|
|
|
373
373
|
|
|
374
374
|
To force a specific language, set `GITPR_LANG=pt_br` or `GITPR_LANG=en` in `~/.gitpr/.env`.
|
|
375
375
|
|
|
376
|
-
> 📖 **Full developer guide:** [docs/i18n_explanation
|
|
376
|
+
> 📖 **Full developer guide:** [gitpr.natanfiuza.dev.br/docs/i18n_explanation](https://gitpr.natanfiuza.dev.br/docs/i18n_explanation) — architecture, usage patterns, circular import precautions, and how to add new languages.
|
|
377
377
|
|
|
378
378
|
## 🔄 Hook Scripts Versioning & Auto-Sync
|
|
379
379
|
|
|
@@ -431,7 +431,7 @@ gitpr-mcp --install auto # Auto-detect and install for all found
|
|
|
431
431
|
The installer creates the config directory if needed, merges with any existing
|
|
432
432
|
config (never overwrites other servers), and is safe to run multiple times.
|
|
433
433
|
|
|
434
|
-
> Manual setup is also supported — see [docs/mcp-integration
|
|
434
|
+
> Manual setup is also supported — see [gitpr.natanfiuza.dev.br/docs/mcp-integration](https://gitpr.natanfiuza.dev.br/docs/mcp-integration)
|
|
435
435
|
> for the JSON config format for each editor.
|
|
436
436
|
|
|
437
437
|
Once configured, use natural language in your editor's AI chat:
|
|
@@ -479,11 +479,11 @@ gitpr-mcp --tool analyze_blame --tool-args '{"file_path":"src/main.py","start_li
|
|
|
479
479
|
|
|
480
480
|
This is useful for scripting, CI/CD pipelines, and one-off queries where you don't need a persistent MCP server. JSON output goes to stdout; all diagnostic messages go to stderr — safe for piping.
|
|
481
481
|
|
|
482
|
-
📖 **Full documentation:** [docs/mcp-integration
|
|
482
|
+
📖 **Full documentation:** [gitpr.natanfiuza.dev.br/docs/mcp-integration](https://gitpr.natanfiuza.dev.br/docs/mcp-integration) — available in 5 languages (EN, PT-BR, PT-PT, ES, FR).
|
|
483
483
|
|
|
484
|
-
> 🧩 **Official VS Code & Cursor Extension** — Prefer native editor commands, SCM toolbar buttons, and inline `Problems` diagnostics? Install the thin-client extension in [`extensions/vscode/`](https://
|
|
484
|
+
> 🧩 **Official VS Code & Cursor Extension** — Prefer native editor commands, SCM toolbar buttons, and inline `Problems` diagnostics? Install the thin-client extension in [`extensions/vscode/`](https://gitpr.natanfiuza.dev.br/docs/editor-extension), powered by `gitpr-mcp`.
|
|
485
485
|
|
|
486
|
-
> 💬 **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://
|
|
486
|
+
> 💬 **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://gitpr.natanfiuza.dev.br/docs/mcp-prompts) for the full list.
|
|
487
487
|
|
|
488
488
|
## 🎯 Smart Excludes (Token Optimization)
|
|
489
489
|
|
|
@@ -517,7 +517,7 @@ GitPR automatically removes non-code files from your `git diff` before sending t
|
|
|
517
517
|
|
|
518
518
|
Add framework-specific build artifacts, generated folders, or any pattern that only applies to this project. The file is safe to commit — your team gets the same exclusions.
|
|
519
519
|
|
|
520
|
-
> 📖 **Full documentation:** [docs/smart-excludes
|
|
520
|
+
> 📖 **Full documentation:** [gitpr.natanfiuza.dev.br/docs/smart-excludes](https://gitpr.natanfiuza.dev.br/docs/smart-excludes) — available in 5 languages (EN, PT-BR, PT-PT, FR, ES).
|
|
521
521
|
|
|
522
522
|
## 📁 Output Directory Structure
|
|
523
523
|
|
|
@@ -545,51 +545,51 @@ If you want to implement GitPR as an automated quality barrier in your team, che
|
|
|
545
545
|
|
|
546
546
|
### Chat & Interactive Features
|
|
547
547
|
|
|
548
|
-
* [**🧠 Interactive Chat (Pair Programming)**](https://
|
|
548
|
+
* [**🧠 Interactive Chat (Pair Programming)**](https://gitpr.natanfiuza.dev.br/docs/understanding_chat_functionality) — How to use the AI chat with memory, slash commands, auto-patch, and session export.
|
|
549
549
|
|
|
550
550
|
### DevOps & CI/CD
|
|
551
551
|
|
|
552
|
-
* [**Local Git Hooks (Shift-Left)**](https://
|
|
553
|
-
* [**Hook Scripts Versioning & Auto-Sync**](https://
|
|
554
|
-
* [**Customizable Static Linter**](https://
|
|
555
|
-
* [**CI/CD Integration (GitHub Actions)**](https://
|
|
552
|
+
* [**Local Git Hooks (Shift-Left)**](https://gitpr.natanfiuza.dev.br/docs/git-hooks-locais) — How to use `gitpr --installhooks` to create guardrails on the developer's machine and use AI to automatically write commit messages.
|
|
553
|
+
* [**Hook Scripts Versioning & Auto-Sync**](https://gitpr.natanfiuza.dev.br/docs/hooks-versioning) — How the automatic versioning and i18n-aware synchronization system keeps your Git hooks up to date.
|
|
554
|
+
* [**Customizable Static Linter**](https://gitpr.natanfiuza.dev.br/docs/linter-regras-customizadas) — How to create validation rules in `.gitpr.linter.yml`, bridge external linters (ESLint, PHPCS, Stylelint), and generate Markdown reports for CI/CD and pre-commit hooks.
|
|
555
|
+
* [**CI/CD Integration (GitHub Actions)**](https://gitpr.natanfiuza.dev.br/docs/github-ci-linter) — How to run GitPR in the pipeline to block "Merge" of PRs with violations.
|
|
556
556
|
|
|
557
557
|
### Core Features
|
|
558
558
|
|
|
559
|
-
* [**Guided Tour (gitpr demo)**](https://
|
|
560
|
-
* [**Pull Request Badge**](https://
|
|
561
|
-
* [**Pull Request (Default Mode)**](https://
|
|
562
|
-
* [**Pull Request Publisher TUI**](https://
|
|
563
|
-
* [**AI Code Review**](https://
|
|
564
|
-
* [**Remote Pull Request Review (gitpr review-pr)**](https://
|
|
565
|
-
* [**AI Commit Messages**](https://
|
|
566
|
-
* [**Issue Generation and TUI Interface**](https://
|
|
567
|
-
* [**Code Archaeologist (Git Blame)**](https://
|
|
568
|
-
* [**Skills and Templates System**](https://
|
|
569
|
-
* [**Release Notes & Changelog (gitpr release)**](https://
|
|
570
|
-
* [**Fix Command (gitpr fix)**](https://
|
|
571
|
-
* [**Split Command (gitpr split)**](https://
|
|
572
|
-
* [**Local Risk Scoring (gitpr risk)**](https://
|
|
573
|
-
* [**Policy Packs (gitpr policy)**](https://
|
|
574
|
-
* [**Baseline & Auditable Suppressions (gitpr baseline)**](https://
|
|
559
|
+
* [**Guided Tour (gitpr demo)**](https://gitpr.natanfiuza.dev.br/docs/demo) — How the `gitpr demo` subcommand walks through the commit message, the code review and the pull request description over a recorded example, with no API key, no repository and no network.
|
|
560
|
+
* [**Pull Request Badge**](https://gitpr.natanfiuza.dev.br/docs/badge) — What the badge GitPR attaches to published pull requests says, where it is attached, when it is left out, and how to print the static one for your own README.
|
|
561
|
+
* [**Pull Request (Default Mode)**](https://gitpr.natanfiuza.dev.br/docs/pr-descricao-padrao) — Complete flow for generating PR descriptions without flags.
|
|
562
|
+
* [**Pull Request Publisher TUI**](https://gitpr.natanfiuza.dev.br/docs/pull-request-publication) — How to review and publish Pull Requests directly to GitHub from the terminal.
|
|
563
|
+
* [**AI Code Review**](https://gitpr.natanfiuza.dev.br/docs/code-review-ia) — Guide to review modes (`--review`, `--fullreview`), file auditing (`--input`) and remote pull request review (`gitpr review-pr`).
|
|
564
|
+
* [**Remote Pull Request Review (gitpr review-pr)**](https://gitpr.natanfiuza.dev.br/docs/review-pr) — How the `gitpr review-pr` subcommand reviews a pull request that is already open on the forge, fetching its diff from the API without checking out its branch.
|
|
565
|
+
* [**AI Commit Messages**](https://gitpr.natanfiuza.dev.br/docs/commit-message-ia) — How to generate messages in the Conventional Commits standard and integrate with Git Hooks.
|
|
566
|
+
* [**Issue Generation and TUI Interface**](https://gitpr.natanfiuza.dev.br/docs/issue-tui-help) — How to use the terminal graphical interface (TUI) and the 3 context engines to manage structured Issues.
|
|
567
|
+
* [**Code Archaeologist (Git Blame)**](https://gitpr.natanfiuza.dev.br/docs/blame-arqueologo) — How to trace the origin of business rules with `git blame` and AI.
|
|
568
|
+
* [**Skills and Templates System**](https://gitpr.natanfiuza.dev.br/docs/skill-template) — How to customize AI behavior with `.gitpr.*.md` files.
|
|
569
|
+
* [**Release Notes & Changelog (gitpr release)**](https://gitpr.natanfiuza.dev.br/docs/release-notes) — How the `gitpr release` subcommand generates the changelog / release notes of a repository from the delta of the previous version, links every commit, pull request and contributor, suggests the next semantic version and publishes releases on the forge.
|
|
570
|
+
* [**Fix Command (gitpr fix)**](https://gitpr.natanfiuza.dev.br/docs/fix-command) — How the `gitpr fix` subcommand turns the findings of the last review into patches you read before they touch your tree, classifies each one by safety, and undoes an applied patch on demand.
|
|
571
|
+
* [**Split Command (gitpr split)**](https://gitpr.natanfiuza.dev.br/docs/split-command) — How the `gitpr split` subcommand reads a working tree holding several concerns, groups the hunks by intent with AI, and turns them into ordered atomic commits without ever writing to your files.
|
|
572
|
+
* [**Local Risk Scoring (gitpr risk)**](https://gitpr.natanfiuza.dev.br/docs/risk-scoring) — How the `gitpr risk` command evaluates regression risk, decomposes signals (50/30/20 formula), and highlights high-risk areas in code reviews offline.
|
|
573
|
+
* [**Policy Packs (gitpr policy)**](https://gitpr.natanfiuza.dev.br/docs/policy-packs) — How a repository adopts a versioned Policy Pack that carries skills, linter rules, severity overrides, critical paths and risk weights together, the precedence ladder that combines packs, the lockfile the team commits, and the three failures that abort instead of silently degrading.
|
|
574
|
+
* [**Baseline & Auditable Suppressions (gitpr baseline)**](https://gitpr.natanfiuza.dev.br/docs/baseline-suppressions) — How a legacy repository records the findings it already has, how a run classifies them as `new`, `existing`, `resolved`, `ignored` or `accepted_debt`, why only `new` blocks, what the fingerprint hashes and what it deliberately leaves out, the four scopes of a suppression, the checksum that catches a hand edit, and the `baseline:` block a Policy Pack may carry.
|
|
575
575
|
|
|
576
576
|
### Configuration & Infrastructure
|
|
577
577
|
|
|
578
|
-
* [**Editor Extension (VS Code & Cursor)**](https://
|
|
579
|
-
* [**Interactive Configuration TUI (gitpr config)**](https://
|
|
580
|
-
* [**Multi-Forge SCM Integration**](https://
|
|
581
|
-
* [**Suggested Reviewers**](https://
|
|
582
|
-
* [**Usage Telemetry & Audit Log**](https://
|
|
583
|
-
* [**Install Wizard**](https://
|
|
584
|
-
* [**AI Providers**](https://
|
|
585
|
-
* [**Auto-Updater**](https://
|
|
586
|
-
* [**Architecture**](https://
|
|
587
|
-
* [**GitHub Token (PAT) Integration and Security**](https://
|
|
588
|
-
* [**Internationalization (i18n)**](https://
|
|
589
|
-
* [**MCP Integration**](https://
|
|
590
|
-
* [**MCP Prompts**](https://
|
|
591
|
-
* [**MCP Tool Annotations**](https://
|
|
592
|
-
* [**Metrics & Telemetry**](https://
|
|
578
|
+
* [**Editor Extension (VS Code & Cursor)**](https://gitpr.natanfiuza.dev.br/docs/editor-extension) — Thin-client VSIX extension driving `gitpr-mcp` over stdio for SCM commit generation, Markdown code reviews, two-step PR publishing, and inline `Problems` diagnostics.
|
|
579
|
+
* [**Interactive Configuration TUI (gitpr config)**](https://gitpr.natanfiuza.dev.br/docs/config-tui) — Master-detail terminal interface to view, edit, and validate settings in `~/.gitpr/.env`.
|
|
580
|
+
* [**Multi-Forge SCM Integration**](https://gitpr.natanfiuza.dev.br/docs/scm-multiforge) — Unified SCM provider layer for GitHub, GitLab, Bitbucket Cloud, and Azure DevOps with `--init` wizard.
|
|
581
|
+
* [**Suggested Reviewers**](https://gitpr.natanfiuza.dev.br/docs/suggested-reviewers) — Automatic reviewer suggestion via Git blame of added lines mapped to forge logins.
|
|
582
|
+
* [**Usage Telemetry & Audit Log**](https://gitpr.natanfiuza.dev.br/docs/usage-log) — Local invocation logging and audit history for tracking CLI executions.
|
|
583
|
+
* [**Install Wizard**](https://gitpr.natanfiuza.dev.br/docs/install-wizard) — Step-by-step guided setup for configuring GitPR in a new project.
|
|
584
|
+
* [**AI Providers**](https://gitpr.natanfiuza.dev.br/docs/providers-ia) — Configuration and selection between Google Gemini, DeepSeek, and Ollama.
|
|
585
|
+
* [**Auto-Updater**](https://gitpr.natanfiuza.dev.br/docs/auto-update) — How GitPR's automatic update and the mandatory update block work.
|
|
586
|
+
* [**Architecture**](https://gitpr.natanfiuza.dev.br/docs/ARCHITECTURE) — Project architecture, design patterns, and technical stack overview.
|
|
587
|
+
* [**GitHub Token (PAT) Integration and Security**](https://gitpr.natanfiuza.dev.br/docs/github-pat-integration) — Understand how GitPR creates issues directly in the repository with authentication.
|
|
588
|
+
* [**Internationalization (i18n)**](https://gitpr.natanfiuza.dev.br/docs/i18n_explanation) — Architecture, usage patterns, and how to add new languages.
|
|
589
|
+
* [**MCP Integration**](https://gitpr.natanfiuza.dev.br/docs/mcp-integration) — Connect GitPR to VS Code, Cursor, and Claude Desktop via Model Context Protocol.
|
|
590
|
+
* [**MCP Prompts**](https://gitpr.natanfiuza.dev.br/docs/mcp-prompts) — Pre-built message templates (7 prompts, 35 language variants) for common GitPR workflows in your editor's AI chat.
|
|
591
|
+
* [**MCP Tool Annotations**](https://gitpr.natanfiuza.dev.br/docs/mcp-annotations) — IDE integration hints (`readOnlyHint`, `destructiveHint`) for smarter UI behavior and safer tool execution.
|
|
592
|
+
* [**Metrics & Telemetry**](https://gitpr.natanfiuza.dev.br/docs/metricas-telemetria) — Local offline analytics for team usage metrics, exportable CSV reports, and interactive TUI dashboard.
|
|
593
593
|
|
|
594
594
|
## ⚡ Local Cache System (Quota Savings)
|
|
595
595
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
gitpr_cli-1.4.
|
|
1
|
+
gitpr_cli-1.4.2.dist-info/licenses/LICENSE,sha256=UQzLC6mwqb-ZNDkBBAqOxC-SMQcEID0gaM6oFcu6u48,27030
|
|
2
2
|
src/__init__.py,sha256=WZW9x8P5CYnru29UiarFa8q1nQzuwYWyIodSOlruCWI,29
|
|
3
3
|
src/ai_providers.py,sha256=QyFEOsXyA59lZziO5bl-4nlYFJpxBcxU9aLhcTBnkWE,14633
|
|
4
4
|
src/blame_engine.py,sha256=Zov1hxrt7Dcmf56ovJKz3QmHIfzDKtSub2iItXeg9-A,17104
|
|
5
|
-
src/cache.py,sha256=
|
|
5
|
+
src/cache.py,sha256=frROc69NyTn3TdJIOPctvuH9z_sh2pdKxL4ekMtyh6k,6572
|
|
6
6
|
src/changelog_builder.py,sha256=8GicvIhREWo3B8XhQugVi2_OWzhN_ik_2GxpxmiJVTg,9650
|
|
7
7
|
src/chat_memory.py,sha256=PcohnyspAfIwwwbsp9U2Wk_1AylJMFEMoWqRSJe_w30,8949
|
|
8
8
|
src/commit_classifier.py,sha256=pgZRj8JvkCBgwgzDFNjjNKJKzddVB4HoPBcFM1F0zjE,6742
|
|
9
9
|
src/config.py,sha256=5bs6jxxg-CwmtGfJB2eoMUbwRddOnc_MCcadOOcMbHg,53637
|
|
10
10
|
src/config_schema.py,sha256=z-JC5rULAVkaQG4ppmVcdeNKLGpuXFqglzvCBgZjHVo,43308
|
|
11
|
-
src/core.py,sha256=
|
|
11
|
+
src/core.py,sha256=6t2lPcoB1HUdXUaoqSpRLIxMIJ_0E_m6zNKn0BzSZYg,85856
|
|
12
12
|
src/diff_parser.py,sha256=62X69ves4tlzNgVKXNsfWdOMwqn2h16RkUOPqszMU7k,11252
|
|
13
13
|
src/doc_links.py,sha256=DuovU-RF9kjbisBdEoGAsuavQ2y0MYDhqy6Sz6vbrGI,1157
|
|
14
14
|
src/github_api.py,sha256=ILm7e03UP80swc3XuJvIJJvhLp81-V_3kQQ1EuAcN8Q,3836
|
|
15
15
|
src/i18n.py,sha256=PdUmtZlH1zogbiDc3j6xiwtnvUd7XiNbiS-xKjYK4WM,4844
|
|
16
|
-
src/issue_engine.py,sha256=
|
|
16
|
+
src/issue_engine.py,sha256=RmZsQVg6N1vCcpMdv_5FX-cMGgQ3I0vwMN4parQ4zFg,10974
|
|
17
17
|
src/ledger.py,sha256=s10Sm0qcA1b916X7m8d2osDThCmSK0UQnmUrkyj8Eao,43663
|
|
18
18
|
src/linter_engine.py,sha256=hIxht8M09Fnm6NiJZOqjI6dyqnFoHUDVA8Ve4dWZV4s,25214
|
|
19
19
|
src/linter_wizard.py,sha256=7J_nQFghVwCaKG6QI3K45KcOaxHSH1oTCAvP_6tnCQM,7424
|
|
20
|
-
src/main.py,sha256=
|
|
20
|
+
src/main.py,sha256=qWtf9ryGOS_elZgfV1I2rOWUzW9U7HD0XqnOGwwGu4o,214873
|
|
21
21
|
src/mcp_server.py,sha256=gi4LmMYVN4CZWHQgb-5aV5UD2O-tRYzc_BqNg7t-EFA,111654
|
|
22
22
|
src/metrics.py,sha256=M4Yqa__giuhmkElT-XOWrTfHGsjK_URVLhIZvErD2f0,39560
|
|
23
23
|
src/net.py,sha256=f0MOkXyIxi4HVetsybtWpV_yHjiC17T2JMWySBdoV2I,2774
|
|
@@ -29,7 +29,7 @@ src/security_ruleset.py,sha256=L754S4RlVoZGWm0nuCoeli9-49mKydZpwi31V319DQ0,4337
|
|
|
29
29
|
src/spinner.py,sha256=63pEotiDa3TVwBr-sn0MJoDPQ_uWJTTwINXieJIDDKc,8964
|
|
30
30
|
src/suggest_reviewers.py,sha256=-wRe0HYksx4FWQZ-eDvU9Ghdk5gqtEt457KQP7sE31Y,5181
|
|
31
31
|
src/tui_issue.py,sha256=WEFxT4kzWQ_KbSDsOnS_iuYXasZySB-68jryGNm0peg,10331
|
|
32
|
-
src/updater.py,sha256=
|
|
32
|
+
src/updater.py,sha256=8AGxl_Lil9K3Laydw3f7yDipuuy6p3XokCOidfUyVR0,4771
|
|
33
33
|
src/usage_log.py,sha256=FdfSmZKL_I5BcG750rD4gl3pNHx0jqV8Shij5XkAnzc,4381
|
|
34
34
|
src/version_bump.py,sha256=OjqJe9OL1-1dT5od7-SgU5ZN_dTtR_aKX_oSjSY64YQ,2954
|
|
35
35
|
src/application/__init__.py,sha256=0GADzpCB3CdCzw-d3az0DVOtTvXfCppt-0hY-Js5a1U,29
|
|
@@ -41,8 +41,8 @@ src/application/use_cases/calculate_risk.py,sha256=oh327qPomI_sO8JXErAHATafu_21K
|
|
|
41
41
|
src/application/use_cases/compare_against_baseline.py,sha256=qgidzsloF5b84LXGb42ae4bDdRGBbGTRepLm1Yb9FmA,1875
|
|
42
42
|
src/application/use_cases/create_baseline.py,sha256=LpXHlF9IkD4P4FL4VKJOh5YyCgfAD6hjt_0bQLy1pqI,25928
|
|
43
43
|
src/application/use_cases/generate_mentor_explanation.py,sha256=KNj5cDm-i7aPJxxbbLm4Hvtv7g5CI59-pbX7tHPcEtM,9428
|
|
44
|
-
src/application/use_cases/generate_pr_explanation.py,sha256=
|
|
45
|
-
src/application/use_cases/generate_test_file.py,sha256=
|
|
44
|
+
src/application/use_cases/generate_pr_explanation.py,sha256=Xbn1b9G57O18pT-_FLA_wAEJmyeLCv1n80p49WVxxjo,3336
|
|
45
|
+
src/application/use_cases/generate_test_file.py,sha256=r8kpNFPD5zU0vsshAzqqspU9stlCnopQzS9cwP5XT-I,9410
|
|
46
46
|
src/application/use_cases/install_policy_pack.py,sha256=U1XvkHt0elXvyM2VRc6TPNukhUomSI2BSWj09hmLC_8,2745
|
|
47
47
|
src/application/use_cases/publish_pull_request.py,sha256=DPK8ERbO2fsjoWUhcLQs10z1WhHVhsfTvtGumn50uIA,9369
|
|
48
48
|
src/application/use_cases/resolve_effective_policy.py,sha256=nTbjRR4di1GnCRV7l3yDNw27CQV3heAd45sftHxNyNc,7563
|
|
@@ -81,7 +81,7 @@ src/domain/policy/policy_manifest.py,sha256=hXIM4u-tKYXTcEu0rBEGJYBuv4dysn9NEjhx
|
|
|
81
81
|
src/domain/policy/policy_resolver.py,sha256=5oTVHysPIwRJibRtRp3U3zOJpS07EBRfkhsmpfI6wcE,28883
|
|
82
82
|
src/domain/policy/policy_types.py,sha256=lhGxapRFAPiVCjmZtwZ9EVViSkDYCJ6UiKNVsaPKvDw,9875
|
|
83
83
|
src/domain/pr/__init__.py,sha256=O9C2dQpbMnbF3mOXTMUvHPmIAF0G-QxhDlVXjB_wShs,274
|
|
84
|
-
src/domain/pr/explain_section_builder.py,sha256=
|
|
84
|
+
src/domain/pr/explain_section_builder.py,sha256=CttuvidDN3OaZrK8wDSCo_wAGa4bwqDyF7923TBqTuE,5023
|
|
85
85
|
src/domain/risk/__init__.py,sha256=9vbLfhIomCarCbEw_DCZzri9lzV-lFIXBN-FAq6oSPY,283
|
|
86
86
|
src/domain/risk/risk_calculator.py,sha256=zjIoLIRdXi3pHNbq0QcRwOznArtNtQQWV8ReLaW6Zn4,5037
|
|
87
87
|
src/domain/risk/risk_explanation.py,sha256=YuPMBT27x7rnZnmvttIWBsfbTjsIXjMUEP9WLU4VlvE,3005
|
|
@@ -166,8 +166,8 @@ src/ui/demo/__init__.py,sha256=PGXenIwpS1lVDE164CZ55q8_65XtJq5H300NIpnqOh0,58
|
|
|
166
166
|
src/ui/demo/demo_app.py,sha256=EDeuqxh_v9KrPhib49TyirmFlHZN7I5NQkg9AjDGhcs,3074
|
|
167
167
|
src/ui/demo/demo_help_screen.py,sha256=m8SuvhzGmkMsahUBA6Aq7ull4W65nS0KOX4hLx-GGps,2056
|
|
168
168
|
src/ui/demo/demo_screens.py,sha256=3Ntp-A7OB43yEtniRqV1UKWc-p5lHRyxeadpe8bxJpM,1937
|
|
169
|
-
gitpr_cli-1.4.
|
|
170
|
-
gitpr_cli-1.4.
|
|
171
|
-
gitpr_cli-1.4.
|
|
172
|
-
gitpr_cli-1.4.
|
|
173
|
-
gitpr_cli-1.4.
|
|
169
|
+
gitpr_cli-1.4.2.dist-info/METADATA,sha256=rdUlN_BJSULMQ64zu-PNoDrxHaaTlmCoSTxqRdSF_wc,51553
|
|
170
|
+
gitpr_cli-1.4.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
171
|
+
gitpr_cli-1.4.2.dist-info/entry_points.txt,sha256=TstGnMUzdOI5qNmpM97EPDBPuMqOZxoo6EoLxHSOMSQ,71
|
|
172
|
+
gitpr_cli-1.4.2.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4
|
|
173
|
+
gitpr_cli-1.4.2.dist-info/RECORD,,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import sys
|
|
2
3
|
from src.ai_providers import call_ai_model
|
|
3
4
|
from src.config import get_ai_provider, get_api_key, get_api_model
|
|
4
5
|
from src.core import get_skill_context
|
|
5
6
|
from src.domain.pr.explain_section_builder import PrExplanation, parse_explain_payload
|
|
7
|
+
from src.i18n import __
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
def generate_pr_explanation(
|
|
@@ -25,13 +27,20 @@ def generate_pr_explanation(
|
|
|
25
27
|
provider = ai_provider or get_ai_provider()
|
|
26
28
|
api_key = get_api_key(provider)
|
|
27
29
|
if not api_key:
|
|
30
|
+
print(
|
|
31
|
+
__(
|
|
32
|
+
"❌ No API key configured for {provider}. Generate one with --install.",
|
|
33
|
+
provider=provider,
|
|
34
|
+
),
|
|
35
|
+
file=sys.stderr,
|
|
36
|
+
)
|
|
28
37
|
return PrExplanation(
|
|
29
|
-
what_changes="
|
|
30
|
-
why_it_changes="
|
|
38
|
+
what_changes="",
|
|
39
|
+
why_it_changes="",
|
|
31
40
|
reviewer_focus_points=[],
|
|
32
|
-
regression_risk="
|
|
41
|
+
regression_risk="",
|
|
33
42
|
has_sufficient_evidence=False,
|
|
34
|
-
markdown="
|
|
43
|
+
markdown="",
|
|
35
44
|
)
|
|
36
45
|
|
|
37
46
|
api_model = get_api_model(provider, task_complexity="advanced")
|
|
@@ -185,16 +185,28 @@ def generate_test_file(
|
|
|
185
185
|
warnings=warnings,
|
|
186
186
|
)
|
|
187
187
|
|
|
188
|
-
# 6. Parse AI JSON
|
|
188
|
+
# 6. Parse AI JSON (call_ai_model returns a parsed dict; raw strings are
|
|
189
|
+
# still accepted for compatibility with cached and legacy responses)
|
|
189
190
|
test_code = ""
|
|
190
191
|
covered_scenarios = []
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
data = ai_raw if isinstance(ai_raw, dict) else None
|
|
193
|
+
if data is None and isinstance(ai_raw, str):
|
|
194
|
+
try:
|
|
195
|
+
data = json.loads(ai_raw)
|
|
196
|
+
except Exception:
|
|
197
|
+
data = None
|
|
198
|
+
|
|
199
|
+
if isinstance(data, dict):
|
|
200
|
+
test_code = data.get("content") or ""
|
|
201
|
+
if not isinstance(test_code, str):
|
|
202
|
+
test_code = str(test_code)
|
|
203
|
+
raw_scenarios = data.get("covered_scenarios") or []
|
|
204
|
+
if isinstance(raw_scenarios, list):
|
|
205
|
+
covered_scenarios = [str(sc) for sc in raw_scenarios]
|
|
206
|
+
raw_warnings = data.get("warnings")
|
|
207
|
+
if isinstance(raw_warnings, list):
|
|
208
|
+
warnings.extend(str(w) for w in raw_warnings)
|
|
209
|
+
elif isinstance(ai_raw, str):
|
|
198
210
|
# If response wasn't strict JSON, use clean raw text
|
|
199
211
|
test_code = ai_raw.strip()
|
|
200
212
|
if test_code.startswith("```"):
|
|
@@ -205,6 +217,14 @@ def generate_test_file(
|
|
|
205
217
|
lines = lines[:-1]
|
|
206
218
|
test_code = "\n".join(lines).strip()
|
|
207
219
|
covered_scenarios.append("Generated from raw model output")
|
|
220
|
+
else:
|
|
221
|
+
warnings.append("AI model returned an unsupported response.")
|
|
222
|
+
return GeneratedTest(
|
|
223
|
+
scaffold=scaffold,
|
|
224
|
+
content="",
|
|
225
|
+
covered_scenarios=[],
|
|
226
|
+
warnings=warnings,
|
|
227
|
+
)
|
|
208
228
|
|
|
209
229
|
# 7. Validate Syntax
|
|
210
230
|
is_valid, syn_err = validate_test_syntax(test_code, detected_fw)
|
src/cache.py
CHANGED
|
@@ -21,10 +21,20 @@ def get_git_user_info():
|
|
|
21
21
|
"""Recupera o nome e email configurados no git local."""
|
|
22
22
|
try:
|
|
23
23
|
name = subprocess.run(
|
|
24
|
-
["git", "config", "user.name"],
|
|
24
|
+
["git", "config", "user.name"],
|
|
25
|
+
capture_output=True,
|
|
26
|
+
text=True,
|
|
27
|
+
encoding="utf-8",
|
|
28
|
+
errors="replace",
|
|
29
|
+
check=True,
|
|
25
30
|
).stdout.strip()
|
|
26
31
|
email = subprocess.run(
|
|
27
|
-
["git", "config", "user.email"],
|
|
32
|
+
["git", "config", "user.email"],
|
|
33
|
+
capture_output=True,
|
|
34
|
+
text=True,
|
|
35
|
+
encoding="utf-8",
|
|
36
|
+
errors="replace",
|
|
37
|
+
check=True,
|
|
28
38
|
).stdout.strip()
|
|
29
39
|
return name, email
|
|
30
40
|
except subprocess.CalledProcessError:
|
src/core.py
CHANGED
|
@@ -1443,6 +1443,8 @@ def get_base_branch():
|
|
|
1443
1443
|
capture_output=True,
|
|
1444
1444
|
stdin=subprocess.DEVNULL,
|
|
1445
1445
|
text=True,
|
|
1446
|
+
encoding="utf-8",
|
|
1447
|
+
errors="replace",
|
|
1446
1448
|
check=True,
|
|
1447
1449
|
)
|
|
1448
1450
|
# The return is something like 'refs/remotes/origin/main', so we get the last part
|
|
@@ -1467,6 +1469,9 @@ def get_git_full_diff():
|
|
|
1467
1469
|
check=True,
|
|
1468
1470
|
capture_output=True,
|
|
1469
1471
|
stdin=subprocess.DEVNULL,
|
|
1472
|
+
text=True,
|
|
1473
|
+
encoding="utf-8",
|
|
1474
|
+
errors="replace",
|
|
1470
1475
|
)
|
|
1471
1476
|
|
|
1472
1477
|
base_branch = get_base_branch()
|
|
@@ -1477,6 +1482,8 @@ def get_git_full_diff():
|
|
|
1477
1482
|
capture_output=True,
|
|
1478
1483
|
stdin=subprocess.DEVNULL,
|
|
1479
1484
|
text=True,
|
|
1485
|
+
encoding="utf-8",
|
|
1486
|
+
errors="replace",
|
|
1480
1487
|
check=True,
|
|
1481
1488
|
)
|
|
1482
1489
|
ancestor_hash = merge_base_res.stdout.strip()
|
|
@@ -1499,6 +1506,7 @@ def get_git_full_diff():
|
|
|
1499
1506
|
stdin=subprocess.DEVNULL,
|
|
1500
1507
|
text=True,
|
|
1501
1508
|
encoding="utf-8",
|
|
1509
|
+
errors="replace",
|
|
1502
1510
|
check=True,
|
|
1503
1511
|
)
|
|
1504
1512
|
return result.stdout
|
|
@@ -2043,6 +2051,8 @@ def get_branch_history_text():
|
|
|
2043
2051
|
capture_output=True,
|
|
2044
2052
|
stdin=subprocess.DEVNULL,
|
|
2045
2053
|
text=True,
|
|
2054
|
+
encoding="utf-8",
|
|
2055
|
+
errors="replace",
|
|
2046
2056
|
check=True,
|
|
2047
2057
|
)
|
|
2048
2058
|
ancestor_hash = merge_base_res.stdout.strip()
|
|
@@ -2060,6 +2070,7 @@ def get_branch_history_text():
|
|
|
2060
2070
|
stdin=subprocess.DEVNULL,
|
|
2061
2071
|
text=True,
|
|
2062
2072
|
encoding="utf-8",
|
|
2073
|
+
errors="replace",
|
|
2063
2074
|
check=True,
|
|
2064
2075
|
)
|
|
2065
2076
|
git_log = git_log_res.stdout.strip()
|
|
@@ -67,17 +67,36 @@ def build_explain_markdown(
|
|
|
67
67
|
return "\n".join(lines).strip()
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
def
|
|
71
|
-
"""
|
|
72
|
-
if
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
def _as_text(value: object) -> str:
|
|
71
|
+
"""Normalizes an AI JSON field to a string (None becomes empty)."""
|
|
72
|
+
if value is None:
|
|
73
|
+
return ""
|
|
74
|
+
return value if isinstance(value, str) else str(value)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _empty_explanation() -> PrExplanation:
|
|
78
|
+
"""Explanation for an empty diff or an empty AI payload."""
|
|
79
|
+
return PrExplanation(
|
|
80
|
+
what_changes="",
|
|
81
|
+
why_it_changes="",
|
|
82
|
+
reviewer_focus_points=[],
|
|
83
|
+
regression_risk="",
|
|
84
|
+
has_sufficient_evidence=False,
|
|
85
|
+
markdown="",
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def parse_explain_payload(raw_json_or_text: dict | str | None) -> PrExplanation:
|
|
90
|
+
"""Parses AI output into a PrExplanation object.
|
|
91
|
+
|
|
92
|
+
The provider layer returns a parsed dict (``call_ai_model``), while raw
|
|
93
|
+
strings still reach this function from callers and tests; both are
|
|
94
|
+
accepted. A string that is not valid JSON is treated as raw prose.
|
|
95
|
+
"""
|
|
96
|
+
if not raw_json_or_text:
|
|
97
|
+
return _empty_explanation()
|
|
98
|
+
if isinstance(raw_json_or_text, str) and not raw_json_or_text.strip():
|
|
99
|
+
return _empty_explanation()
|
|
81
100
|
|
|
82
101
|
what = ""
|
|
83
102
|
why = ""
|
|
@@ -86,24 +105,34 @@ def parse_explain_payload(raw_json_or_text: str) -> PrExplanation:
|
|
|
86
105
|
has_evidence = True
|
|
87
106
|
|
|
88
107
|
try:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
108
|
+
if isinstance(raw_json_or_text, dict):
|
|
109
|
+
data = raw_json_or_text
|
|
110
|
+
else:
|
|
111
|
+
data = json.loads(raw_json_or_text)
|
|
112
|
+
if not isinstance(data, dict):
|
|
113
|
+
raise ValueError("Explanation payload is not a JSON object")
|
|
114
|
+
|
|
115
|
+
what = _as_text(data.get("what_changes"))
|
|
116
|
+
why = _as_text(data.get("why_it_changes"))
|
|
117
|
+
risk = _as_text(data.get("regression_risk"))
|
|
118
|
+
raw_points = data.get("reviewer_focus_points") or []
|
|
119
|
+
if isinstance(raw_points, list):
|
|
120
|
+
for raw_pt in raw_points:
|
|
121
|
+
if isinstance(raw_pt, dict):
|
|
122
|
+
file_path = raw_pt.get("file_path")
|
|
123
|
+
related_line = raw_pt.get("related_line")
|
|
124
|
+
focus_points.append(
|
|
125
|
+
ReviewerFocusPoint(
|
|
126
|
+
description=_as_text(raw_pt.get("description")),
|
|
127
|
+
file_path=file_path if isinstance(file_path, str) and file_path else None,
|
|
128
|
+
related_line=related_line if isinstance(related_line, int) else None,
|
|
129
|
+
)
|
|
100
130
|
)
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
focus_points.append(ReviewerFocusPoint(description=raw_pt))
|
|
131
|
+
elif isinstance(raw_pt, str):
|
|
132
|
+
focus_points.append(ReviewerFocusPoint(description=raw_pt))
|
|
104
133
|
except Exception:
|
|
105
134
|
# Fallback if raw text returned
|
|
106
|
-
what = raw_json_or_text.strip()
|
|
135
|
+
what = raw_json_or_text.strip() if isinstance(raw_json_or_text, str) else ""
|
|
107
136
|
why = __("[FILL: Please explain the motivation for these changes]")
|
|
108
137
|
has_evidence = False
|
|
109
138
|
|
src/issue_engine.py
CHANGED
|
@@ -20,7 +20,12 @@ def get_github_repo_info():
|
|
|
20
20
|
"""Extracts the owner/repo format from git remote -v."""
|
|
21
21
|
try:
|
|
22
22
|
result = subprocess.run(
|
|
23
|
-
["git", "remote", "-v"],
|
|
23
|
+
["git", "remote", "-v"],
|
|
24
|
+
capture_output=True,
|
|
25
|
+
text=True,
|
|
26
|
+
encoding="utf-8",
|
|
27
|
+
errors="replace",
|
|
28
|
+
check=True,
|
|
24
29
|
)
|
|
25
30
|
|
|
26
31
|
# Search for patterns like git@github.com:owner/repo.git or https://github.com/owner/repo.git
|
src/main.py
CHANGED
|
@@ -259,7 +259,7 @@ HELP_MAP: dict[str, dict[str, str]] = {
|
|
|
259
259
|
),
|
|
260
260
|
},
|
|
261
261
|
"explain": {
|
|
262
|
-
"url": get_doc_url("
|
|
262
|
+
"url": get_doc_url("explain-pr.md"),
|
|
263
263
|
"title": __("Reviewer Guide (--explain / gitpr explain)"),
|
|
264
264
|
"description": __(
|
|
265
265
|
"Generates a concise reviewer-centric summary (What changes, Why it changes, Where to focus, and Regression risk)."
|
|
@@ -295,6 +295,7 @@ HELP_PRIORITY: dict[str, int] = {
|
|
|
295
295
|
"fullreview": 8,
|
|
296
296
|
"review": 9,
|
|
297
297
|
"mentor": 9,
|
|
298
|
+
"explain": 9,
|
|
298
299
|
"risk": 10,
|
|
299
300
|
"input": 11,
|
|
300
301
|
"history": 12,
|
|
@@ -557,7 +558,7 @@ def _print_baseline_line(compared, quiet=False):
|
|
|
557
558
|
)
|
|
558
559
|
@click.option(
|
|
559
560
|
"--explain",
|
|
560
|
-
"
|
|
561
|
+
"explain",
|
|
561
562
|
is_flag=True,
|
|
562
563
|
help=__(
|
|
563
564
|
"Includes the Reviewer Guide section ('Explain my PR') in the Pull Request description."
|
|
@@ -636,7 +637,7 @@ def cli(
|
|
|
636
637
|
base,
|
|
637
638
|
no_publish,
|
|
638
639
|
no_edit,
|
|
639
|
-
|
|
640
|
+
explain,
|
|
640
641
|
mentor_flag,
|
|
641
642
|
plugins,
|
|
642
643
|
status,
|
|
@@ -1317,10 +1318,18 @@ def cli(
|
|
|
1317
1318
|
|
|
1318
1319
|
try:
|
|
1319
1320
|
git_user = subprocess.run(
|
|
1320
|
-
["git", "config", "user.name"],
|
|
1321
|
+
["git", "config", "user.name"],
|
|
1322
|
+
capture_output=True,
|
|
1323
|
+
text=True,
|
|
1324
|
+
encoding="utf-8",
|
|
1325
|
+
errors="replace",
|
|
1321
1326
|
).stdout.strip()
|
|
1322
1327
|
git_email = subprocess.run(
|
|
1323
|
-
["git", "config", "user.email"],
|
|
1328
|
+
["git", "config", "user.email"],
|
|
1329
|
+
capture_output=True,
|
|
1330
|
+
text=True,
|
|
1331
|
+
encoding="utf-8",
|
|
1332
|
+
errors="replace",
|
|
1324
1333
|
).stdout.strip()
|
|
1325
1334
|
except Exception:
|
|
1326
1335
|
git_user, git_email = "Dev", "dev@local"
|
|
@@ -1440,8 +1449,17 @@ def cli(
|
|
|
1440
1449
|
click.secho(__("🚀 Starting pull request generation..."), fg="cyan")
|
|
1441
1450
|
diff_text = get_git_full_diff()
|
|
1442
1451
|
|
|
1452
|
+
# A git failure is not an empty diff. get_git_full_diff()/get_git_diff()
|
|
1453
|
+
# return None when git fails; folding that into "no new code found" hides it.
|
|
1454
|
+
# Exit non-zero so scripts can tell the two apart. Hook mode fails open: a
|
|
1455
|
+
# non-zero prepare-commit-msg hook makes git abort the user's commit.
|
|
1456
|
+
if diff_text is None:
|
|
1457
|
+
if hook:
|
|
1458
|
+
return
|
|
1459
|
+
raise click.exceptions.Exit(1)
|
|
1460
|
+
|
|
1443
1461
|
# CRITICAL: Warn the user before exiting if there are no changes
|
|
1444
|
-
if not diff_text
|
|
1462
|
+
if not diff_text.strip():
|
|
1445
1463
|
click.secho(
|
|
1446
1464
|
__(
|
|
1447
1465
|
"\n⚠️ No new code found. Make some changes or check your branch before running the command.\n"
|
|
@@ -1604,7 +1622,7 @@ def cli(
|
|
|
1604
1622
|
pr_desc_body = data.get("pr_description", __("No detailed description."))
|
|
1605
1623
|
|
|
1606
1624
|
from src.config import explain_enabled_by_default
|
|
1607
|
-
if
|
|
1625
|
+
if explain or explain_enabled_by_default():
|
|
1608
1626
|
from src.application.use_cases.generate_pr_explanation import generate_pr_explanation
|
|
1609
1627
|
click.secho("🧐 " + __("Generating Reviewer Guide (Explain my PR)..."), fg="cyan", dim=True)
|
|
1610
1628
|
explanation = generate_pr_explanation(diff_text, ai_provider=active_provider, quiet=True)
|
|
@@ -4759,6 +4777,10 @@ def _kept(entry, status_filter, rule_filter, file_filter, overrides):
|
|
|
4759
4777
|
"tests",
|
|
4760
4778
|
context_settings={"help_option_names": ["-h", "--help"]},
|
|
4761
4779
|
invoke_without_command=False,
|
|
4780
|
+
epilog="\b\n"
|
|
4781
|
+
+ __(">> Full documentation:")
|
|
4782
|
+
+ "\n"
|
|
4783
|
+
+ get_doc_url("tests-generate.md"),
|
|
4762
4784
|
)
|
|
4763
4785
|
def tests_group():
|
|
4764
4786
|
"""AI-powered test suite generation and scaffolding."""
|
|
@@ -4769,6 +4791,10 @@ def tests_group():
|
|
|
4769
4791
|
@tests_group.command(
|
|
4770
4792
|
"generate",
|
|
4771
4793
|
context_settings={"help_option_names": ["-h", "--help"]},
|
|
4794
|
+
epilog="\b\n"
|
|
4795
|
+
+ __(">> Full documentation:")
|
|
4796
|
+
+ "\n"
|
|
4797
|
+
+ get_doc_url("tests-generate.md"),
|
|
4772
4798
|
)
|
|
4773
4799
|
@click.option(
|
|
4774
4800
|
"--file",
|
|
@@ -4824,8 +4850,8 @@ def tests_generate(target_file, finding_id, framework_override, apply_flag, ai_p
|
|
|
4824
4850
|
f"Finding: {cand.finding.id} - {cand.finding.message}\n"
|
|
4825
4851
|
f"File: {cand.finding.file_path}:{cand.finding.line_start}-{cand.finding.line_end}\n"
|
|
4826
4852
|
f"Severity: {cand.finding.severity} | Category: {cand.finding.category}\n"
|
|
4827
|
-
f"Suggested Test: {cand.
|
|
4828
|
-
f"Diff:\n{cand.
|
|
4853
|
+
f"Suggested Test: {cand.suggested_test}\n"
|
|
4854
|
+
f"Diff:\n{cand.diff_unified or '(No diff available)'}"
|
|
4829
4855
|
)
|
|
4830
4856
|
except Exception as e:
|
|
4831
4857
|
click.secho(f"⚠️ {e}", fg="yellow")
|
|
@@ -4936,7 +4962,7 @@ def tests_generate(target_file, finding_id, framework_override, apply_flag, ai_p
|
|
|
4936
4962
|
epilog="\b\n"
|
|
4937
4963
|
+ __(">> Full documentation:")
|
|
4938
4964
|
+ "\n"
|
|
4939
|
-
+ get_doc_url("
|
|
4965
|
+
+ get_doc_url("explain-pr.md"),
|
|
4940
4966
|
)
|
|
4941
4967
|
@click.option(
|
|
4942
4968
|
"--provider",
|
src/updater.py
CHANGED
|
@@ -7,7 +7,7 @@ from datetime import datetime
|
|
|
7
7
|
# Current version of your local executable (Update this on every new build!)
|
|
8
8
|
# ── Must stay ABOVE the i18n import: i18n.py lazily imports __lang_version__
|
|
9
9
|
# from here, and pyproject.toml reads __version__ via setuptools attr:.
|
|
10
|
-
__version__ = "1.4.
|
|
10
|
+
__version__ = "1.4.2" # GitPR current version
|
|
11
11
|
__lang_version__ = "v0.0.35" # Language dictionary version control
|
|
12
12
|
__scripts_version__ = (
|
|
13
13
|
"v0.0.4" # Git Hook scripts version control (independent from __lang_version__)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|