auto-code-fixer 0.2.4__tar.gz → 0.2.5__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.
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/PKG-INFO +1 -1
- auto_code_fixer-0.2.5/auto_code_fixer/__init__.py +2 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer/cli.py +20 -1
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer/runner.py +10 -7
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer.egg-info/PKG-INFO +1 -1
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/pyproject.toml +1 -1
- auto_code_fixer-0.2.4/auto_code_fixer/__init__.py +0 -2
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/LICENSE +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/README.md +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer/fixer.py +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer/guard.py +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer/installer.py +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer/utils.py +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer.egg-info/SOURCES.txt +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer.egg-info/dependency_links.txt +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer.egg-info/entry_points.txt +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer.egg-info/requires.txt +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer.egg-info/top_level.txt +0 -0
- {auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/setup.cfg +0 -0
|
@@ -97,7 +97,26 @@ def fix_file(file_path, project_root, api_key, ask, verbose):
|
|
|
97
97
|
log("GPT returned no changes. Stopping.", "WARN")
|
|
98
98
|
break
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
import ast
|
|
101
|
+
|
|
102
|
+
# Validate GPT output BEFORE accepting it
|
|
103
|
+
try:
|
|
104
|
+
ast.parse(fixed_code)
|
|
105
|
+
except SyntaxError:
|
|
106
|
+
log(
|
|
107
|
+
"GPT returned invalid or empty Python code. Rejecting fix.",
|
|
108
|
+
"ERROR",
|
|
109
|
+
)
|
|
110
|
+
break
|
|
111
|
+
|
|
112
|
+
if not fixed_code.strip():
|
|
113
|
+
log(
|
|
114
|
+
"GPT returned empty code. Rejecting fix.",
|
|
115
|
+
"ERROR",
|
|
116
|
+
)
|
|
117
|
+
break
|
|
118
|
+
|
|
119
|
+
# ✅ SAFE: update memory only after validation
|
|
101
120
|
current_code = fixed_code
|
|
102
121
|
|
|
103
122
|
# then update temp file for next execution
|
|
@@ -6,13 +6,16 @@ import sys
|
|
|
6
6
|
def run_code(script_path, project_root):
|
|
7
7
|
env = os.environ.copy()
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
script_dir = os.path.dirname(script_path)
|
|
10
|
+
|
|
11
|
+
# 🔑 CRITICAL: include BOTH project root and script dir
|
|
12
|
+
paths = [project_root, script_dir]
|
|
13
|
+
|
|
14
|
+
existing = env.get("PYTHONPATH", "")
|
|
15
|
+
if existing:
|
|
16
|
+
paths.append(existing)
|
|
17
|
+
|
|
18
|
+
env["PYTHONPATH"] = os.pathsep.join(paths)
|
|
16
19
|
|
|
17
20
|
try:
|
|
18
21
|
result = subprocess.run(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_code_fixer-0.2.4 → auto_code_fixer-0.2.5}/auto_code_fixer.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|