code2llm 0.5.12__tar.gz → 0.5.14__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.
- {code2llm-0.5.12 → code2llm-0.5.14}/PKG-INFO +1 -1
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/__init__.py +1 -1
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/cli.py +13 -1
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/config.py +2 -1
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/nlp/__init__.py +1 -1
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm.egg-info/PKG-INFO +1 -1
- {code2llm-0.5.12 → code2llm-0.5.14}/pyproject.toml +2 -2
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_prompt_txt.py +55 -4
- {code2llm-0.5.12 → code2llm-0.5.14}/LICENSE +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/README.md +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/__main__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/__init__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/call_graph.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/cfg.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/coupling.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/data_analysis.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/dfg.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/pipeline_detector.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/side_effects.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/smells.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/analysis/type_inference.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/__init__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/analyzer.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/core/__init__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/core/file_analyzer.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/core/file_cache.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/core/file_filter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/core/refactoring.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/models.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/streaming/__init__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/streaming/cache.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/streaming/incremental.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/streaming/prioritizer.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/streaming/scanner.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/streaming/strategies.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/core/streaming_analyzer.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/__init__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/base.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/context_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/evolution_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/flow_constants.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/flow_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/flow_renderer.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/json_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/llm_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/map_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/mermaid_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/readme_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/toon/__init__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/toon/helpers.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/toon/metrics.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/toon/module_detail.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/toon/renderer.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/toon.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/exporters/yaml_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/generators/__init__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/generators/llm_flow.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/generators/llm_task.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/generators/mermaid.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/nlp/config.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/nlp/entity_resolution.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/nlp/intent_matching.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/nlp/normalization.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/nlp/pipeline.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/patterns/__init__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/patterns/detector.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/refactor/__init__.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm/refactor/prompt_engine.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm.egg-info/SOURCES.txt +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm.egg-info/dependency_links.txt +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm.egg-info/entry_points.txt +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm.egg-info/requires.txt +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/code2llm.egg-info/top_level.txt +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/setup.cfg +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/setup.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_advanced_analysis.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_analyzer.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_deep_analysis.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_edge_cases.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_flow_exporter.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_format_quality.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_nlp_pipeline.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_pipeline_detector.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_prompt_engine.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_refactoring_engine.py +0 -0
- {code2llm-0.5.12 → code2llm-0.5.14}/tests/test_toon_v2.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2llm
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.14
|
|
4
4
|
Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
|
|
5
5
|
Home-page: https://github.com/wronai/stts
|
|
6
6
|
Author: STTS Project
|
|
@@ -406,13 +406,25 @@ def _export_code2logic(args, source_path: Path, output_dir: Path, formats: list[
|
|
|
406
406
|
'-o', str(output_dir),
|
|
407
407
|
]
|
|
408
408
|
|
|
409
|
+
if not args.verbose:
|
|
410
|
+
cmd.append('-q')
|
|
411
|
+
|
|
409
412
|
try:
|
|
410
|
-
|
|
413
|
+
if args.verbose:
|
|
414
|
+
res = subprocess.run(cmd, capture_output=True, text=True)
|
|
415
|
+
else:
|
|
416
|
+
res = subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, text=True)
|
|
411
417
|
except Exception as e:
|
|
412
418
|
print(f"Error running code2logic: {e}", file=sys.stderr)
|
|
413
419
|
sys.exit(1)
|
|
414
420
|
|
|
415
421
|
if res.returncode != 0:
|
|
422
|
+
if not args.verbose:
|
|
423
|
+
try:
|
|
424
|
+
res = subprocess.run(cmd, capture_output=True, text=True)
|
|
425
|
+
except Exception as e:
|
|
426
|
+
print(f"Error running code2logic: {e}", file=sys.stderr)
|
|
427
|
+
sys.exit(1)
|
|
416
428
|
if res.stdout:
|
|
417
429
|
print(res.stdout, file=sys.stderr)
|
|
418
430
|
if res.stderr:
|
|
@@ -38,7 +38,8 @@ class FilterConfig:
|
|
|
38
38
|
exclude_patterns: List[str] = field(default_factory=lambda: [
|
|
39
39
|
"*test*", "*__pycache__*", "*.pyc", "*venv*", "*.venv*",
|
|
40
40
|
"*node_modules*", "*.git*", "*build*", "*dist*",
|
|
41
|
-
"*_test.py", "test_*.py", "conftest.py"
|
|
41
|
+
"*_test.py", "test_*.py", "conftest.py",
|
|
42
|
+
"*demo_langs/invalid*",
|
|
42
43
|
])
|
|
43
44
|
include_patterns: List[str] = field(default_factory=list)
|
|
44
45
|
min_function_lines: int = 1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2llm
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.14
|
|
4
4
|
Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
|
|
5
5
|
Home-page: https://github.com/wronai/stts
|
|
6
6
|
Author: STTS Project
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "code2llm"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.14"
|
|
8
8
|
description = "High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -75,7 +75,7 @@ line-length = 100
|
|
|
75
75
|
target-version = ['py38']
|
|
76
76
|
|
|
77
77
|
[tool.mypy]
|
|
78
|
-
python_version = "0.5.
|
|
78
|
+
python_version = "0.5.14"
|
|
79
79
|
ignore_missing_imports = true
|
|
80
80
|
|
|
81
81
|
[tool.pytest.ini_options]
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import pytest
|
|
4
4
|
import tempfile
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from unittest.mock import MagicMock
|
|
6
|
+
from unittest.mock import MagicMock, patch
|
|
7
7
|
|
|
8
|
-
from code2llm.cli import _export_prompt_txt
|
|
8
|
+
from code2llm.cli import _export_prompt_txt, _export_code2logic
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class TestPromptTxtGeneration:
|
|
@@ -138,17 +138,68 @@ class TestPromptTxtGeneration:
|
|
|
138
138
|
"Prompt should start with AI assistant instruction"
|
|
139
139
|
assert any("we are in project path:" in line for line in lines), \
|
|
140
140
|
"Project path should be present"
|
|
141
|
+
|
|
141
142
|
assert any("Files for analysis:" in line for line in lines), \
|
|
142
143
|
"Files section should be present"
|
|
143
|
-
|
|
144
|
+
|
|
144
145
|
# All files should be listed without missing section
|
|
145
146
|
assert "Missing files" not in content, "No missing section when all files exist"
|
|
146
147
|
for f in all_files:
|
|
147
148
|
assert f in content, f"All files should be listed: {f}"
|
|
148
|
-
|
|
149
|
+
|
|
149
150
|
# Check for file paths with descriptions
|
|
150
151
|
assert "- " in content, "Files should be listed with bullet points"
|
|
151
152
|
assert "Health diagnostics" in content, "Descriptions should be present"
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class TestCode2logicExport:
|
|
156
|
+
"""Test the _export_code2logic wrapper."""
|
|
157
|
+
|
|
158
|
+
@pytest.fixture
|
|
159
|
+
def temp_output_dir(self):
|
|
160
|
+
"""Create temporary output directory."""
|
|
161
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
162
|
+
yield Path(tmpdir)
|
|
163
|
+
|
|
164
|
+
def test_export_code2logic_adds_quiet_flag_when_not_verbose(self, temp_output_dir):
|
|
165
|
+
args = MagicMock()
|
|
166
|
+
args.verbose = False
|
|
167
|
+
|
|
168
|
+
source_path = Path('/home/user/myproject')
|
|
169
|
+
formats = ['code2logic']
|
|
170
|
+
|
|
171
|
+
completed = MagicMock()
|
|
172
|
+
completed.returncode = 0
|
|
173
|
+
completed.stdout = ""
|
|
174
|
+
completed.stderr = ""
|
|
175
|
+
|
|
176
|
+
with patch('code2llm.cli.shutil.which', return_value='/usr/bin/code2logic'), \
|
|
177
|
+
patch('code2llm.cli.subprocess.run', return_value=completed) as run_mock, \
|
|
178
|
+
patch('pathlib.Path.exists', return_value=True):
|
|
179
|
+
_export_code2logic(args, source_path, temp_output_dir, formats)
|
|
180
|
+
|
|
181
|
+
called_cmd = run_mock.call_args[0][0]
|
|
182
|
+
assert '-q' in called_cmd
|
|
183
|
+
|
|
184
|
+
def test_export_code2logic_does_not_add_quiet_flag_when_verbose(self, temp_output_dir):
|
|
185
|
+
args = MagicMock()
|
|
186
|
+
args.verbose = True
|
|
187
|
+
|
|
188
|
+
source_path = Path('/home/user/myproject')
|
|
189
|
+
formats = ['code2logic']
|
|
190
|
+
|
|
191
|
+
completed = MagicMock()
|
|
192
|
+
completed.returncode = 0
|
|
193
|
+
completed.stdout = ""
|
|
194
|
+
completed.stderr = ""
|
|
195
|
+
|
|
196
|
+
with patch('code2llm.cli.shutil.which', return_value='/usr/bin/code2logic'), \
|
|
197
|
+
patch('code2llm.cli.subprocess.run', return_value=completed) as run_mock, \
|
|
198
|
+
patch('pathlib.Path.exists', return_value=True):
|
|
199
|
+
_export_code2logic(args, source_path, temp_output_dir, formats)
|
|
200
|
+
|
|
201
|
+
called_cmd = run_mock.call_args[0][0]
|
|
202
|
+
assert '-q' not in called_cmd
|
|
152
203
|
|
|
153
204
|
def test_prompt_txt_no_verbose_output(self, temp_output_dir):
|
|
154
205
|
"""Test that no print occurs when verbose is False."""
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|