redup 0.3.18__tar.gz → 0.3.20__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.18 → redup-0.3.20}/PKG-INFO +2 -2
- {redup-0.3.18 → redup-0.3.20}/README.md +1 -1
- {redup-0.3.18 → redup-0.3.20}/pyproject.toml +1 -1
- {redup-0.3.18 → redup-0.3.20}/src/redup/__init__.py +1 -1
- {redup-0.3.18 → redup-0.3.20}/src/redup/cli_app/main.py +2 -12
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/scanner.py +31 -1
- {redup-0.3.18 → redup-0.3.20}/src/redup.egg-info/PKG-INFO +2 -2
- {redup-0.3.18 → redup-0.3.20}/LICENSE +0 -0
- {redup-0.3.18 → redup-0.3.20}/setup.cfg +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/__main__.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/cli_app/__init__.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/__init__.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/cache.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/config.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/differ.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/hash_cache.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/hasher.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/lazy_grouper.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/lsh_matcher.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/matcher.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/memory_scanner.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/models.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/parallel_scanner.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/pipeline.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/planner.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/ts_extractor.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/ultra_fast_scanner.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/utils/__init__.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/utils/duplicate_finders.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/utils/function_extractor.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/utils/hash_utils.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/core/utils/language_dispatcher.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/reporters/__init__.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/reporters/code2llm_reporter.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/reporters/enhanced_reporter.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/reporters/json_reporter.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/reporters/markdown_reporter.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/reporters/toon_reporter.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup/reporters/yaml_reporter.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup.egg-info/SOURCES.txt +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup.egg-info/dependency_links.txt +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup.egg-info/entry_points.txt +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup.egg-info/requires.txt +0 -0
- {redup-0.3.18 → redup-0.3.20}/src/redup.egg-info/top_level.txt +0 -0
- {redup-0.3.18 → redup-0.3.20}/tests/test_e2e.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/tests/test_hasher.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/tests/test_matcher.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/tests/test_models.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/tests/test_pipeline.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/tests/test_planner.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/tests/test_reporters.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/tests/test_scanner.py +0 -0
- {redup-0.3.18 → redup-0.3.20}/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.20
|
|
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
|
|
|
@@ -286,20 +286,10 @@ def scan(
|
|
|
286
286
|
|
|
287
287
|
_print_scan_header(path, config.extensions, config.min_block_lines, config.min_similarity)
|
|
288
288
|
|
|
289
|
-
# Choose analysis method
|
|
290
|
-
if parallel
|
|
291
|
-
# Pure parallel mode (no cache)
|
|
289
|
+
# Choose analysis method
|
|
290
|
+
if parallel:
|
|
292
291
|
dup_map = analyze_parallel(config=config, function_level_only=functions_only, max_workers=max_workers)
|
|
293
|
-
elif parallel or incremental:
|
|
294
|
-
# Optimized mode with cache and/or parallel
|
|
295
|
-
dup_map = analyze_optimized(
|
|
296
|
-
config=config,
|
|
297
|
-
function_level_only=functions_only,
|
|
298
|
-
use_memory_cache=getattr(config, '_memory_cache', True),
|
|
299
|
-
max_cache_mb=getattr(config, '_max_cache_mb', 512)
|
|
300
|
-
)
|
|
301
292
|
else:
|
|
302
|
-
# Standard mode
|
|
303
293
|
dup_map = analyze(config=config, function_level_only=functions_only)
|
|
304
294
|
|
|
305
295
|
_print_scan_summary(dup_map)
|
|
@@ -5,6 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import fnmatch
|
|
6
6
|
import functools
|
|
7
7
|
import mmap
|
|
8
|
+
import os
|
|
8
9
|
import time
|
|
9
10
|
from collections.abc import Iterator
|
|
10
11
|
from dataclasses import dataclass, field
|
|
@@ -61,12 +62,41 @@ def _should_exclude(path: Path, patterns: tuple[str, ...]) -> bool:
|
|
|
61
62
|
return False
|
|
62
63
|
|
|
63
64
|
|
|
65
|
+
def _load_gitignore_patterns(root_path: Path) -> list[str]:
|
|
66
|
+
"""Load exclusion patterns from .gitignore file if it exists."""
|
|
67
|
+
gitignore_path = root_path / ".gitignore"
|
|
68
|
+
patterns = []
|
|
69
|
+
|
|
70
|
+
if gitignore_path.exists():
|
|
71
|
+
try:
|
|
72
|
+
with open(gitignore_path, 'r', encoding='utf-8') as f:
|
|
73
|
+
for line in f:
|
|
74
|
+
line = line.strip()
|
|
75
|
+
# Skip empty lines and comments
|
|
76
|
+
if line and not line.startswith('#'):
|
|
77
|
+
# Remove leading slashes and convert to proper pattern
|
|
78
|
+
pattern = line.lstrip('/')
|
|
79
|
+
# Convert directory patterns (ending with /) to match contents
|
|
80
|
+
if pattern.endswith('/'):
|
|
81
|
+
pattern = pattern.rstrip('/')
|
|
82
|
+
patterns.append(pattern)
|
|
83
|
+
except (OSError, UnicodeDecodeError):
|
|
84
|
+
pass # Silently ignore if we can't read .gitignore
|
|
85
|
+
|
|
86
|
+
return patterns
|
|
87
|
+
|
|
88
|
+
|
|
64
89
|
def _collect_files(config: ScanConfig) -> Iterator[Path]:
|
|
65
90
|
"""Yield all files matching the scan configuration."""
|
|
66
91
|
root = Path(config.root).resolve() if isinstance(config.root, str) else config.root.resolve()
|
|
92
|
+
|
|
93
|
+
# Load .gitignore patterns and merge with default exclude patterns
|
|
94
|
+
gitignore_patterns = _load_gitignore_patterns(root)
|
|
95
|
+
all_exclude_patterns = list(config.exclude_patterns) + gitignore_patterns
|
|
96
|
+
|
|
67
97
|
for ext in config.extensions:
|
|
68
98
|
for path in root.rglob(f"*{ext}"):
|
|
69
|
-
if _should_exclude(path, tuple(
|
|
99
|
+
if _should_exclude(path, tuple(all_exclude_patterns)):
|
|
70
100
|
continue
|
|
71
101
|
if not config.include_tests and _is_test_file(path):
|
|
72
102
|
continue
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: redup
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.20
|
|
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
|
|
File without changes
|
|
File without changes
|