Skip to content
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
63813f7
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
776771b
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
c27f053
Fix corrupted test_shaker.py from bad Copilot Autofix patches
tbjers Jun 7, 2026
878e7e1
Potential fixes for 2 code quality findings (#13)
tbjers Jun 7, 2026
eac65d5
Apply suggested fix to tests/test_shaker.py from Copilot Autofix (#14)
tbjers Jun 7, 2026
7b776ba
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
5a4dcc1
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
2b4d017
Fix docstring module reference and redundant assertion in test_shaker.py
tbjers Jun 7, 2026
25a4ff8
Potential fixes for 2 code quality findings (#13)
tbjers Jun 7, 2026
1adc736
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
6da7609
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
abab619
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
3d27e4b
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
48b2055
Fix corrupted test_shaker.py from bad Copilot Autofix patches
tbjers Jun 7, 2026
3de6802
Potential fixes for 2 code quality findings (#13)
tbjers Jun 7, 2026
c14f131
Potential fixes for 2 code quality findings (#13)
tbjers Jun 7, 2026
3e9c64f
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
d1832a5
Apply suggested fix to tests/test_shaker.py from Copilot Autofix
tbjers Jun 7, 2026
bc08b20
Merge branch 'ai-findings-autofix/tests-test_shaker.py' of https://gi…
tbjers Jun 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions tests/test_shaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,31 @@ def parse(tmp_path: Path, content: str) -> list[Any]:
return getASTfromFile(str(test_file), process_includes=False) or []


def make_pool(tmp_path: Path, content: str) -> dict[str, list]:
def make_pool(
tmp_path: Path, content: str
) -> dict[str, list[FunctionDeclaration | ModuleDeclaration]]:
"""Parse content and return a list-valued pool dict.

This mirrors the private ``_add_to_pool`` behavior in ``openscad_packer.packer``.
"""
nodes = parse(tmp_path, content)
pool: dict[str, list] = {}
pool: dict[str, list[FunctionDeclaration | ModuleDeclaration]] = {}
for node in nodes:
if isinstance(node, (FunctionDeclaration, ModuleDeclaration)):
name = node.name.name
if name not in pool:
pool[name] = []
# Keep at most one declaration per (name, declaration type).
# If another declaration of the same type appears later, it replaces
# the earlier one (latest-wins), while a different type is kept too
# (for example, both a function and a module named "foo").
replace_at: int | None = None
for i, existing in enumerate(pool[name]):
if isinstance(existing, type(node)):
pool[name][i] = node
replace_at = i
break
if replace_at is not None:
pool[name][replace_at] = node
else:
pool[name].append(node)
return pool
Expand Down
Loading