redup 0.3.4__tar.gz → 0.3.6__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.4 → redup-0.3.6}/PKG-INFO +2 -2
- {redup-0.3.4 → redup-0.3.6}/README.md +1 -1
- {redup-0.3.4 → redup-0.3.6}/pyproject.toml +1 -1
- {redup-0.3.4 → redup-0.3.6}/src/redup/__init__.py +1 -1
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/ts_extractor.py +37 -2
- {redup-0.3.4 → redup-0.3.6}/src/redup.egg-info/PKG-INFO +2 -2
- {redup-0.3.4 → redup-0.3.6}/LICENSE +0 -0
- {redup-0.3.4 → redup-0.3.6}/setup.cfg +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/__main__.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/cli_app/__init__.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/cli_app/main.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/__init__.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/config.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/differ.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/hasher.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/lsh_matcher.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/matcher.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/models.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/parallel_scanner.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/pipeline.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/planner.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/scanner.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/utils/__init__.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/utils/duplicate_finders.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/utils/function_extractor.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/core/utils/hash_utils.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/reporters/__init__.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/reporters/enhanced_reporter.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/reporters/json_reporter.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/reporters/markdown_reporter.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/reporters/toon_reporter.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup/reporters/yaml_reporter.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup.egg-info/SOURCES.txt +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup.egg-info/dependency_links.txt +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup.egg-info/entry_points.txt +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup.egg-info/requires.txt +0 -0
- {redup-0.3.4 → redup-0.3.6}/src/redup.egg-info/top_level.txt +0 -0
- {redup-0.3.4 → redup-0.3.6}/tests/test_e2e.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/tests/test_hasher.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/tests/test_matcher.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/tests/test_models.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/tests/test_pipeline.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/tests/test_planner.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/tests/test_reporters.py +0 -0
- {redup-0.3.4 → redup-0.3.6}/tests/test_scanner.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.6
|
|
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
|
|
|
@@ -60,6 +60,8 @@ _LANGUAGE_MAPPING = {
|
|
|
60
60
|
# Python (fallback to AST)
|
|
61
61
|
".py": "python",
|
|
62
62
|
".pyw": "python",
|
|
63
|
+
# Lua
|
|
64
|
+
".lua": "lua",
|
|
63
65
|
# Ruby
|
|
64
66
|
".rb": "ruby",
|
|
65
67
|
".rbw": "ruby",
|
|
@@ -345,8 +347,8 @@ def extract_functions_treesitter(source: str, file_path: str) -> list[CodeBlock]
|
|
|
345
347
|
return _extract_blocks_css(tree.root_node, source_lines, file_path)
|
|
346
348
|
elif language_name == "sql":
|
|
347
349
|
return _extract_blocks_sql(tree.root_node, source_lines, file_path)
|
|
348
|
-
elif language_name in ("json", "yaml", "toml", "markdown", "embedded_template", "regex"):
|
|
349
|
-
# Data formats and
|
|
350
|
+
elif language_name in ("json", "yaml", "toml", "markdown", "embedded_template", "regex", "graphql", "dockerfile", "make", "vim", "nginx", "svelte", "vue"):
|
|
351
|
+
# Data formats, markup languages, config files, and template languages don't have functions in the traditional sense
|
|
350
352
|
return []
|
|
351
353
|
|
|
352
354
|
return []
|
|
@@ -509,6 +511,39 @@ def _extract_blocks_sql(node: Any, source_lines: list[str], file_path: str) -> l
|
|
|
509
511
|
return blocks
|
|
510
512
|
|
|
511
513
|
|
|
514
|
+
def _extract_functions_lua(node: Any, source_lines: list[str], file_path: str) -> list[CodeBlock]:
|
|
515
|
+
"""Extract functions from Lua using tree-sitter."""
|
|
516
|
+
blocks = []
|
|
517
|
+
|
|
518
|
+
def traverse(node: Any, depth: int = 0) -> None:
|
|
519
|
+
if depth > 50:
|
|
520
|
+
return
|
|
521
|
+
|
|
522
|
+
node_type = node.type
|
|
523
|
+
|
|
524
|
+
# Function declarations (local function, function)
|
|
525
|
+
if node_type in ("function_declaration", "local_function"):
|
|
526
|
+
start_line = node.start_point[0] + 1
|
|
527
|
+
end_line = node.end_point[0] + 1
|
|
528
|
+
|
|
529
|
+
name_node = node.child_by_field_name("name")
|
|
530
|
+
function_name = name_node.text.decode() if name_node else "anonymous"
|
|
531
|
+
|
|
532
|
+
blocks.append(CodeBlock(
|
|
533
|
+
file=file_path,
|
|
534
|
+
line_start=start_line,
|
|
535
|
+
line_end=end_line,
|
|
536
|
+
text="\n".join(source_lines[start_line-1:end_line]),
|
|
537
|
+
function_name=function_name,
|
|
538
|
+
class_name=None,
|
|
539
|
+
))
|
|
540
|
+
|
|
541
|
+
for child in node.children:
|
|
542
|
+
traverse(child, depth + 1)
|
|
543
|
+
|
|
544
|
+
return blocks
|
|
545
|
+
|
|
546
|
+
|
|
512
547
|
def _extract_functions_c_sharp(node: Any, source_lines: list[str], file_path: str) -> list[CodeBlock]:
|
|
513
548
|
"""Extract functions from C# using tree-sitter."""
|
|
514
549
|
blocks = []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: redup
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.6
|
|
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
|