Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Replace redbaron with python's ast module inside the module loader. #133

Merged
merged 5 commits into from
Jul 6, 2023

Conversation

bhavitsharma
Copy link
Collaborator

@bhavitsharma bhavitsharma commented Jul 6, 2023

Replace RedBaron with python's AST module in the python loader.
Next steps:

  • Replace it inside the reader/writer/navigation/symbol_utils.
  • Replace it everywhere else

self,
root_fpath: str = get_root_fpath(),
py_fpath: str = get_root_py_fpath(),
parsing_strategy: Union[None, ParsingStrategy] = None,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use Optional instead of Union[None,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooo, nice catch

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also prototype a pr-review agent which suggests fixes based on code review comments

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@@ -94,7 +94,7 @@ def _remove_docstrings(node: FSTNode) -> None:
if child_node is not node:
_remove_docstrings(child_node)

module = py_module_loader.fetch_module(module_dotpath)
module = cast(RedBaron, py_module_loader.fetch_module(module_dotpath))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the ugly cast, will be going away in next PR

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nw

@emrgnt-cmplxty emrgnt-cmplxty merged commit b9fae27 into main Jul 6, 2023
6 checks passed
@emrgnt-cmplxty emrgnt-cmplxty deleted the replace_redbaron_with_ast_ branch July 6, 2023 16:39
@bhavitsharma bhavitsharma restored the replace_redbaron_with_ast_ branch July 6, 2023 19:43
@emrgnt-cmplxty emrgnt-cmplxty deleted the replace_redbaron_with_ast_ branch July 6, 2023 21:51
Huntemall pushed a commit to Huntemall/automata-dev that referenced this pull request Oct 30, 2023
…or-the-agent-config-complex

major refactor
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants