gitpr-cli 0.0.11__tar.gz → 0.0.12__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.11/src/gitpr_cli.egg-info → gitpr_cli-0.0.12}/PKG-INFO +1 -1
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12/gitpr_cli.egg-info}/PKG-INFO +1 -1
- gitpr_cli-0.0.12/gitpr_cli.egg-info/SOURCES.txt +19 -0
- gitpr_cli-0.0.12/gitpr_cli.egg-info/top_level.txt +1 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/pyproject.toml +5 -2
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/src/core.py +11 -5
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/src/updater.py +1 -1
- gitpr_cli-0.0.11/src/gitpr_cli.egg-info/SOURCES.txt +0 -19
- gitpr_cli-0.0.11/src/gitpr_cli.egg-info/top_level.txt +0 -9
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/LICENSE +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/README.md +0 -0
- {gitpr_cli-0.0.11/src → gitpr_cli-0.0.12}/gitpr_cli.egg-info/dependency_links.txt +0 -0
- {gitpr_cli-0.0.11/src → gitpr_cli-0.0.12}/gitpr_cli.egg-info/entry_points.txt +0 -0
- {gitpr_cli-0.0.11/src → gitpr_cli-0.0.12}/gitpr_cli.egg-info/requires.txt +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/setup.cfg +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/src/__init__.py +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/src/ai_providers.py +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/src/cache.py +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/src/config.py +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/src/linter_engine.py +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/src/main.py +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/src/security.py +0 -0
- {gitpr_cli-0.0.11 → gitpr_cli-0.0.12}/tests/test_core.py +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
gitpr_cli.egg-info/PKG-INFO
|
|
5
|
+
gitpr_cli.egg-info/SOURCES.txt
|
|
6
|
+
gitpr_cli.egg-info/dependency_links.txt
|
|
7
|
+
gitpr_cli.egg-info/entry_points.txt
|
|
8
|
+
gitpr_cli.egg-info/requires.txt
|
|
9
|
+
gitpr_cli.egg-info/top_level.txt
|
|
10
|
+
src/__init__.py
|
|
11
|
+
src/ai_providers.py
|
|
12
|
+
src/cache.py
|
|
13
|
+
src/config.py
|
|
14
|
+
src/core.py
|
|
15
|
+
src/linter_engine.py
|
|
16
|
+
src/main.py
|
|
17
|
+
src/security.py
|
|
18
|
+
src/updater.py
|
|
19
|
+
tests/test_core.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
src
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "gitpr-cli"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.12"
|
|
8
8
|
description = "Automação de PRs, Commits e Code Review com IA (Gemini e DeepSeek)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -21,4 +21,7 @@ dependencies = [
|
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
[project.scripts]
|
|
24
|
-
gitpr = "src.main:cli"
|
|
24
|
+
gitpr = "src.main:cli"
|
|
25
|
+
|
|
26
|
+
[tool.setuptools]
|
|
27
|
+
packages = ["src"]
|
|
@@ -15,15 +15,16 @@ from src.ai_providers import call_ai_model
|
|
|
15
15
|
def get_git_diff():
|
|
16
16
|
"""Executa 'git diff HEAD' e retorna a saída, alertando sobre arquivos não monitorados (untracked)."""
|
|
17
17
|
try:
|
|
18
|
-
# Verifica se existem arquivos novos não monitorados (untracked)
|
|
18
|
+
# 1. Verifica se existem arquivos novos não monitorados (untracked)
|
|
19
19
|
untracked_process = subprocess.run(
|
|
20
20
|
["git", "ls-files", "--others", "--exclude-standard"],
|
|
21
21
|
capture_output=True,
|
|
22
22
|
text=True,
|
|
23
|
-
encoding="utf-8"
|
|
23
|
+
encoding="utf-8",
|
|
24
|
+
errors="replace" # <--- CORREÇÃO AQUI (Evita crash com acentos)
|
|
24
25
|
)
|
|
25
26
|
untracked_files = untracked_process.stdout.strip()
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
# Se houver arquivos novos, exibe um alerta educativo no console
|
|
28
29
|
if untracked_files:
|
|
29
30
|
click.secho("⚠️ Aviso: O Git detectou novos arquivos que não estão sendo monitorados:", fg="yellow")
|
|
@@ -31,13 +32,14 @@ def get_git_diff():
|
|
|
31
32
|
click.secho(f" - {file}", fg="yellow", dim=True)
|
|
32
33
|
click.secho("💡 Dica: Use 'git add <arquivo>' para que eles sejam incluídos na análise do GitPR.", fg="cyan")
|
|
33
34
|
click.secho("📚 Entenda o motivo: https://github.com/natanfiuza/gitpr/blob/main/docs/untracked-files.md\n", fg="blue", underline=True)
|
|
34
|
-
|
|
35
|
-
#
|
|
35
|
+
|
|
36
|
+
# 2. Executa o diff normal que captura arquivos monitorados e em staging
|
|
36
37
|
result = subprocess.run(
|
|
37
38
|
["git", "diff", "HEAD"],
|
|
38
39
|
capture_output=True,
|
|
39
40
|
text=True,
|
|
40
41
|
encoding="utf-8",
|
|
42
|
+
errors="replace", # <--- CORREÇÃO AQUI (Evita crash com acentos)
|
|
41
43
|
check=True
|
|
42
44
|
)
|
|
43
45
|
return result.stdout
|
|
@@ -98,6 +100,7 @@ def get_skill_context(action_type="pr"):
|
|
|
98
100
|
# Retorna vazio se não existir
|
|
99
101
|
return ""
|
|
100
102
|
|
|
103
|
+
|
|
101
104
|
def generate_pr_content(action_folder, action_type, diff_text, provider="gemini"):
|
|
102
105
|
"""Envia o diff para a IA usando System Instruction e retorna um JSON parseado."""
|
|
103
106
|
if not diff_text or not diff_text.strip():
|
|
@@ -168,6 +171,7 @@ def generate_pr_content(action_folder, action_type, diff_text, provider="gemini"
|
|
|
168
171
|
|
|
169
172
|
return None
|
|
170
173
|
|
|
174
|
+
|
|
171
175
|
def generate_skill_template():
|
|
172
176
|
"""
|
|
173
177
|
Faz o download dos templates .gitpr.pr.md, .gitpr.review.md
|
|
@@ -219,6 +223,7 @@ def generate_skill_template():
|
|
|
219
223
|
else:
|
|
220
224
|
click.echo("\nNenhum arquivo novo foi baixado.")
|
|
221
225
|
|
|
226
|
+
|
|
222
227
|
def get_base_branch():
|
|
223
228
|
"""Descobre a branch principal remota (ex: main ou master)."""
|
|
224
229
|
try:
|
|
@@ -233,6 +238,7 @@ def get_base_branch():
|
|
|
233
238
|
click.secho("⚠️ Aviso: Branch principal remota não detectada. Assumindo 'main' como fallback padrão.", fg="yellow")
|
|
234
239
|
return "main" # Fallback padrão caso não encontre
|
|
235
240
|
|
|
241
|
+
|
|
236
242
|
def get_git_full_diff():
|
|
237
243
|
"""Faz o fetch e captura o diff entre a branch principal remota e o estado atual."""
|
|
238
244
|
click.secho("🔄 Sincronizando com o repositório remoto (git fetch)...", fg="cyan")
|
|
@@ -6,7 +6,7 @@ import shutil
|
|
|
6
6
|
import click
|
|
7
7
|
|
|
8
8
|
# Versão atual do seu executável local (Atualize isso a cada novo build!)
|
|
9
|
-
__version__ = "0.0.
|
|
9
|
+
__version__ = "0.0.12"
|
|
10
10
|
GITHUB_API_URL = "https://api.github.com/repos/natanfiuza/gitpr/releases/latest"
|
|
11
11
|
|
|
12
12
|
def get_gitpr_dir():
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
LICENSE
|
|
2
|
-
README.md
|
|
3
|
-
pyproject.toml
|
|
4
|
-
src/__init__.py
|
|
5
|
-
src/ai_providers.py
|
|
6
|
-
src/cache.py
|
|
7
|
-
src/config.py
|
|
8
|
-
src/core.py
|
|
9
|
-
src/linter_engine.py
|
|
10
|
-
src/main.py
|
|
11
|
-
src/security.py
|
|
12
|
-
src/updater.py
|
|
13
|
-
src/gitpr_cli.egg-info/PKG-INFO
|
|
14
|
-
src/gitpr_cli.egg-info/SOURCES.txt
|
|
15
|
-
src/gitpr_cli.egg-info/dependency_links.txt
|
|
16
|
-
src/gitpr_cli.egg-info/entry_points.txt
|
|
17
|
-
src/gitpr_cli.egg-info/requires.txt
|
|
18
|
-
src/gitpr_cli.egg-info/top_level.txt
|
|
19
|
-
tests/test_core.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|