codemodder /PATH/TO/zulip --codemod-include=fix-mutable-params
It will be necessary to come up with a unit test that minimally reproduces the problem and then fix it.
File "/Users/danieldavella/miniconda3/envs/test-python-codemod-package/lib/python3.10/site-packages/libcst/matchers/_visitors.py", line 515, in on_leave
retval = CSTTransformer.on_leave(self, original_node, updated_node)
File "/Users/danieldavella/miniconda3/envs/test-python-codemod-package/lib/python3.10/site-packages/libcst/_visitors.py", line 71, in on_leave
updated_node = leave_func(original_node, updated_node)
File "/Users/danieldavella/codemodder-python/src/core_codemods/fix_mutable_params.py", line 180, in leave_FunctionDef
body=updated_node.body.with_changes(body=new_body),
File "/Users/danieldavella/miniconda3/envs/test-python-codemod-package/lib/python3.10/site-packages/libcst/_nodes/base.py", line 325, in with_changes
return replace(self, **changes)
File "/Users/danieldavella/miniconda3/envs/test-python-codemod-package/lib/python3.10/dataclasses.py", line 1453, in replace
return obj.__class__(**changes)
File "<string>", line 6, in __init__
File "/Users/danieldavella/miniconda3/envs/test-python-codemod-package/lib/python3.10/site-packages/libcst/_nodes/base.py", line 117, in __post_init__
self._validate()
File "/Users/danieldavella/miniconda3/envs/test-python-codemod-package/lib/python3.10/site-packages/libcst/_nodes/statement.py", line 390, in _validate
if small_stmt.semicolon is None:
AttributeError: 'SimpleStatementLine' object has no attribute 'semicolon'
Description
The
fix-mutable-paramscodemod appears to result in anAttributeErrorin certain circumstances. This was originally detected while processing this open source project: https://github.com/zulip/zulipAfter checking out use the following command to reproduce:
It will be necessary to come up with a unit test that minimally reproduces the problem and then fix it.
Traceback