redup 0.3.16__tar.gz → 0.3.17__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.
- {redup-0.3.16 → redup-0.3.17}/PKG-INFO +2 -2
- {redup-0.3.16 → redup-0.3.17}/README.md +1 -1
- {redup-0.3.16 → redup-0.3.17}/pyproject.toml +1 -1
- {redup-0.3.16 → redup-0.3.17}/src/redup/__init__.py +1 -1
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/hasher.py +1 -1
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/pipeline.py +3 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/scanner.py +1 -3
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/ultra_fast_scanner.py +1 -5
- {redup-0.3.16 → redup-0.3.17}/src/redup.egg-info/PKG-INFO +2 -2
- {redup-0.3.16 → redup-0.3.17}/LICENSE +0 -0
- {redup-0.3.16 → redup-0.3.17}/setup.cfg +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/__main__.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/cli_app/__init__.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/cli_app/main.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/__init__.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/cache.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/config.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/differ.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/hash_cache.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/lazy_grouper.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/lsh_matcher.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/matcher.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/memory_scanner.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/models.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/parallel_scanner.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/planner.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/ts_extractor.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/utils/__init__.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/utils/duplicate_finders.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/utils/function_extractor.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/utils/hash_utils.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/core/utils/language_dispatcher.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/reporters/__init__.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/reporters/code2llm_reporter.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/reporters/enhanced_reporter.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/reporters/json_reporter.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/reporters/markdown_reporter.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/reporters/toon_reporter.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup/reporters/yaml_reporter.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup.egg-info/SOURCES.txt +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup.egg-info/dependency_links.txt +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup.egg-info/entry_points.txt +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup.egg-info/requires.txt +0 -0
- {redup-0.3.16 → redup-0.3.17}/src/redup.egg-info/top_level.txt +0 -0
- {redup-0.3.16 → redup-0.3.17}/tests/test_e2e.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/tests/test_hasher.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/tests/test_matcher.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/tests/test_models.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/tests/test_pipeline.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/tests/test_planner.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/tests/test_reporters.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/tests/test_scanner.py +0 -0
- {redup-0.3.16 → redup-0.3.17}/tests/test_ts_extractor.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: redup
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.17
|
|
4
4
|
Summary: Code duplication analyzer and refactoring planner for LLMs
|
|
5
5
|
Author-email: Tom Sapletta <tom@sapletta.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -83,7 +83,7 @@ Dynamic: license-file
|
|
|
83
83
|
[](https://pypi.org/project/redup/)
|
|
84
84
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
85
85
|
[](https://python.org)
|
|
86
|
-
[](https://pypi.org/project/redup/)
|
|
87
87
|
|
|
88
88
|
reDUP scans codebases for duplicated functions, blocks, and structural patterns — then builds a prioritized refactoring map that LLMs can consume to eliminate redundancy systematically.
|
|
89
89
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://pypi.org/project/redup/)
|
|
6
6
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
7
7
|
[](https://python.org)
|
|
8
|
-
[](https://pypi.org/project/redup/)
|
|
9
9
|
|
|
10
10
|
reDUP scans codebases for duplicated functions, blocks, and structural patterns — then builds a prioritized refactoring map that LLMs can consume to eliminate redundancy systematically.
|
|
11
11
|
|
|
@@ -39,7 +39,7 @@ def _normalize_text(text: str) -> str:
|
|
|
39
39
|
# Vectorized: single list comprehension pass instead of loop
|
|
40
40
|
lines = text.splitlines()
|
|
41
41
|
result_lines = [
|
|
42
|
-
|
|
42
|
+
processed for line in lines
|
|
43
43
|
if (line.strip() and not _MULTILINE_STRING_RE.match(line))
|
|
44
44
|
for processed in [_COMMENT_RE.sub("", line).strip()]
|
|
45
45
|
if processed # Skip empty lines (only comments)
|
|
@@ -244,6 +244,9 @@ def _ensure_config(config: ScanConfig | None) -> ScanConfig:
|
|
|
244
244
|
|
|
245
245
|
def _scan_phase(config: ScanConfig, function_level_only: bool = False) -> tuple[list[ScannedFile], ScanStats]:
|
|
246
246
|
"""Phase 1: Scan project files with ultra-fast optimization."""
|
|
247
|
+
# Set functions_only flag in config for ultra_fast_scanner compatibility
|
|
248
|
+
config.functions_only = function_level_only or getattr(config, 'functions_only', False)
|
|
249
|
+
|
|
247
250
|
# Use ultra-fast scanner by default for 4x speedup
|
|
248
251
|
if getattr(config, 'use_ultra_fast_scanner', False):
|
|
249
252
|
return scan_project_ultra_fast(config)
|
|
@@ -63,7 +63,7 @@ def _should_exclude(path: Path, patterns: tuple[str, ...]) -> bool:
|
|
|
63
63
|
|
|
64
64
|
def _collect_files(config: ScanConfig) -> Iterator[Path]:
|
|
65
65
|
"""Yield all files matching the scan configuration."""
|
|
66
|
-
root = config.root.resolve()
|
|
66
|
+
root = Path(config.root).resolve() if isinstance(config.root, str) else config.root.resolve()
|
|
67
67
|
for ext in config.extensions:
|
|
68
68
|
for path in root.rglob(f"*{ext}"):
|
|
69
69
|
if _should_exclude(path, tuple(config.exclude_patterns)):
|
|
@@ -249,7 +249,6 @@ def _preload_files_to_ram(config: ScanConfig) -> list[tuple[Path, str]]:
|
|
|
249
249
|
Returns list of (path, content) tuples. Filters out files exceeding size limit.
|
|
250
250
|
"""
|
|
251
251
|
files_content: list[tuple[Path, str]] = []
|
|
252
|
-
total_size = 0
|
|
253
252
|
|
|
254
253
|
for filepath in _collect_files(config):
|
|
255
254
|
# Check size first to avoid loading huge files
|
|
@@ -263,7 +262,6 @@ def _preload_files_to_ram(config: ScanConfig) -> list[tuple[Path, str]]:
|
|
|
263
262
|
source = _read_file_optimized(filepath, config.max_file_size_kb)
|
|
264
263
|
if source is not None:
|
|
265
264
|
files_content.append((filepath, source))
|
|
266
|
-
total_size += len(source)
|
|
267
265
|
|
|
268
266
|
return files_content
|
|
269
267
|
|
|
@@ -83,15 +83,11 @@ def preload_to_ram(config: ScanConfig, show_progress: bool = True) -> dict[Path,
|
|
|
83
83
|
size_mb = total_size / 1e6
|
|
84
84
|
print(f"📁 Preloaded {len(sources)} files to RAM ({size_mb:.1f}MB) in {load_time:.2f}s")
|
|
85
85
|
|
|
86
|
-
# Early exit: if no files
|
|
86
|
+
# Early exit: if no files, return immediately
|
|
87
87
|
if len(sources) == 0:
|
|
88
88
|
print("🔍 No files to scan")
|
|
89
89
|
return {}
|
|
90
90
|
|
|
91
|
-
if total_size < 1000: # Less than 1KB total
|
|
92
|
-
print("🔍 Project too small for meaningful analysis")
|
|
93
|
-
return {}
|
|
94
|
-
|
|
95
91
|
return sources
|
|
96
92
|
|
|
97
93
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: redup
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.17
|
|
4
4
|
Summary: Code duplication analyzer and refactoring planner for LLMs
|
|
5
5
|
Author-email: Tom Sapletta <tom@sapletta.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -83,7 +83,7 @@ Dynamic: license-file
|
|
|
83
83
|
[](https://pypi.org/project/redup/)
|
|
84
84
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
85
85
|
[](https://python.org)
|
|
86
|
-
[](https://pypi.org/project/redup/)
|
|
87
87
|
|
|
88
88
|
reDUP scans codebases for duplicated functions, blocks, and structural patterns — then builds a prioritized refactoring map that LLMs can consume to eliminate redundancy systematically.
|
|
89
89
|
|
|
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
|