redup 0.3.28__tar.gz → 0.3.29__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.28 → redup-0.3.29}/PKG-INFO +2 -2
- {redup-0.3.28 → redup-0.3.29}/README.md +1 -1
- {redup-0.3.28 → redup-0.3.29}/pyproject.toml +1 -1
- {redup-0.3.28 → redup-0.3.29}/src/redup/__init__.py +1 -1
- {redup-0.3.28 → redup-0.3.29}/src/redup/cli_app/scan_commands.py +2 -2
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/pipeline.py +6 -1
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/scanner.py +6 -2
- {redup-0.3.28 → redup-0.3.29}/src/redup.egg-info/PKG-INFO +2 -2
- {redup-0.3.28 → redup-0.3.29}/LICENSE +0 -0
- {redup-0.3.28 → redup-0.3.29}/setup.cfg +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/__main__.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/cli_app/__init__.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/cli_app/config_builder.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/cli_app/fuzzy_similarity.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/cli_app/main.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/cli_app/output_writer.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/cli_app/scan_helpers.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/__init__.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/cache.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/config.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/differ.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/fuzzy_similarity.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/hash_cache.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/hasher.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/lazy_grouper.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/lsh_matcher.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/matcher.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/models.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/planner.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/ts_extractor.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/universal_fuzzy.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/utils/__init__.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/utils/duplicate_finders.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/utils/function_extractor.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/utils/hash_utils.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/core/utils/language_dispatcher.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/reporters/__init__.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/reporters/code2llm_reporter.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/reporters/enhanced_reporter.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/reporters/json_reporter.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/reporters/markdown_reporter.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/reporters/toon_reporter.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup/reporters/yaml_reporter.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup.egg-info/SOURCES.txt +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup.egg-info/dependency_links.txt +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup.egg-info/entry_points.txt +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup.egg-info/requires.txt +0 -0
- {redup-0.3.28 → redup-0.3.29}/src/redup.egg-info/top_level.txt +0 -0
- {redup-0.3.28 → redup-0.3.29}/tests/test_e2e.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/tests/test_hasher.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/tests/test_matcher.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/tests/test_models.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/tests/test_pipeline.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/tests/test_planner.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/tests/test_reporters.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/tests/test_scanner.py +0 -0
- {redup-0.3.28 → redup-0.3.29}/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.29
|
|
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
|
|
@@ -84,7 +84,7 @@ Dynamic: license-file
|
|
|
84
84
|
[](https://pypi.org/project/redup/)
|
|
85
85
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
86
86
|
[](https://python.org)
|
|
87
|
-
[](https://pypi.org/project/redup/)
|
|
88
88
|
|
|
89
89
|
reDUP scans codebases for duplicated functions, blocks, and structural patterns — then builds a prioritized refactoring map that LLMs can consume to eliminate redundancy systematically.
|
|
90
90
|
|
|
@@ -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
|
|
|
@@ -21,7 +21,7 @@ def scan_command(
|
|
|
21
21
|
min_lines: Any = typer.Option(None, "--min-lines", help="Minimum block size (lines). Overrides config."),
|
|
22
22
|
min_similarity: Any = typer.Option(None, "--min-sim", help="Minimum similarity score (0.0-1.0). Overrides config."),
|
|
23
23
|
include_tests: bool = typer.Option(False, "--include-tests", help="Include test files in analysis."),
|
|
24
|
-
functions_only: bool = typer.Option(
|
|
24
|
+
functions_only: bool = typer.Option(True, "--functions-only/--no-functions-only", help="Only analyze function-level duplicates (default: enabled for speed)."),
|
|
25
25
|
parallel: bool = typer.Option(False, "--parallel", help="Use parallel processing for faster analysis."),
|
|
26
26
|
max_workers: Any = typer.Option(None, "--max-workers", help="Maximum number of parallel workers."),
|
|
27
27
|
incremental: bool = typer.Option(False, "--incremental", help="Use incremental scanning (cache-based)."),
|
|
@@ -50,7 +50,7 @@ def scan_command(
|
|
|
50
50
|
elif memory_cache:
|
|
51
51
|
dup_map = analyze_optimized(config, use_memory_cache=True, max_cache_mb=max_cache_mb)
|
|
52
52
|
else:
|
|
53
|
-
dup_map = analyze(config
|
|
53
|
+
dup_map = analyze(config)
|
|
54
54
|
|
|
55
55
|
# Apply fuzzy similarity if requested
|
|
56
56
|
if fuzzy:
|
|
@@ -104,7 +104,7 @@ def _deduplicate_groups(groups: list[DuplicateGroup]) -> list[DuplicateGroup]:
|
|
|
104
104
|
|
|
105
105
|
def analyze(
|
|
106
106
|
config: ScanConfig | None = None,
|
|
107
|
-
function_level_only: bool =
|
|
107
|
+
function_level_only: bool | None = None,
|
|
108
108
|
) -> DuplicationMap:
|
|
109
109
|
"""Run the full reDUP analysis pipeline.
|
|
110
110
|
|
|
@@ -112,12 +112,17 @@ def analyze(
|
|
|
112
112
|
config: Scan configuration. Defaults to current directory, .py files.
|
|
113
113
|
function_level_only: If True, only analyze function-level blocks
|
|
114
114
|
(skip sliding-window line blocks). Faster but misses inline duplicates.
|
|
115
|
+
If None, uses config.functions_only.
|
|
115
116
|
|
|
116
117
|
Returns:
|
|
117
118
|
A DuplicationMap with all duplicate groups and refactoring suggestions.
|
|
118
119
|
"""
|
|
119
120
|
config = _ensure_config(config)
|
|
120
121
|
|
|
122
|
+
# Use config.functions_only if function_level_only is not explicitly provided
|
|
123
|
+
if function_level_only is None:
|
|
124
|
+
function_level_only = config.functions_only
|
|
125
|
+
|
|
121
126
|
# Phase 1: Scan with function_level_only optimization
|
|
122
127
|
scanned_files, stats = _scan_phase(config, function_level_only=function_level_only)
|
|
123
128
|
|
|
@@ -175,6 +175,10 @@ def _is_test_file(path: Path) -> bool:
|
|
|
175
175
|
name = path.name.lower()
|
|
176
176
|
dir_parts = [part.lower() for part in path.parts]
|
|
177
177
|
|
|
178
|
+
# Skip pytest temp directories
|
|
179
|
+
if any("pytest-" in part for part in dir_parts):
|
|
180
|
+
return False
|
|
181
|
+
|
|
178
182
|
# Check filename patterns
|
|
179
183
|
test_patterns = [
|
|
180
184
|
"test_", "_test.", "tests.", "spec_", "_spec."
|
|
@@ -183,8 +187,8 @@ def _is_test_file(path: Path) -> bool:
|
|
|
183
187
|
if any(pattern in name for pattern in test_patterns):
|
|
184
188
|
return True
|
|
185
189
|
|
|
186
|
-
# Check directory patterns
|
|
187
|
-
if any("test" in part for part in dir_parts):
|
|
190
|
+
# Check directory patterns (but not pytest temp dirs)
|
|
191
|
+
if any("test" in part and "pytest-" not in part for part in dir_parts):
|
|
188
192
|
return True
|
|
189
193
|
|
|
190
194
|
return False
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: redup
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.29
|
|
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
|
|
@@ -84,7 +84,7 @@ Dynamic: license-file
|
|
|
84
84
|
[](https://pypi.org/project/redup/)
|
|
85
85
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
86
86
|
[](https://python.org)
|
|
87
|
-
[](https://pypi.org/project/redup/)
|
|
88
88
|
|
|
89
89
|
reDUP scans codebases for duplicated functions, blocks, and structural patterns — then builds a prioritized refactoring map that LLMs can consume to eliminate redundancy systematically.
|
|
90
90
|
|
|
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
|