fix: clean up misc_tools_parser.py#817
Conversation
There was a problem hiding this comment.
Pull request overview
Cleanup-focused PR for misc_tools_parser.py (Fixes #814) to improve typing correctness, naming, and logging consistency in the external project parser.
Changes:
- Remove unused imports and replace
xmlrpc.client.booleanwith built-inbool. - Fix parser name typo (
miscelaneous→miscellaneous). - Standardize logging by using the module-level
loggerand replacingprint()withlogger.info(). - Add
List[defs.Tool]return/type annotations forparse_toolandtool_entries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
application/utils/external_project_parsers/parsers/misc_tools_parser.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Cleans up misc_tools_parser.py to improve typing accuracy, fix a parser display-name typo, and make logging consistent with other external project parsers (per #814).
Changes:
- Remove unused imports and replace
xmlrpc.client.booleanwith built-inboolfordry_run. - Fix parser name typo (
miscelaneous→miscellaneous) and standardize logging (logging.error/print→ modulelogger). - Add
List[defs.Tool]type annotations forparse_toolandtool_entries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
application/utils/external_project_parsers/parsers/misc_tools_parser.py
Outdated
Show resolved
Hide resolved
application/utils/external_project_parsers/parsers/misc_tools_parser.py
Outdated
Show resolved
Hide resolved
Deez-Automations
left a comment
There was a problem hiding this comment.
Addressed the review comments
- fixed the dry_run early return to avoid UnboundLocalError
- added an empty list check in parse() to prevent IndexError
- improved the error message to include the readme path and repo url
|
The e2e workflow failure appears to be a workflow file issue not related to this change, this PR only touches misc_tools_parser.py with no changes to tests or CI config. Happy to investigate further if needed. |
- removed unused NamedTuple import - replaced xmlrpc.client.boolean with built-in bool - fixed typo in parser name (miscelaneous -> miscellaneous) - standardized logging to use module-level logger instead of root logging - replaced print() with logger.info() for consistency - added proper type annotations (List[defs.Tool]) to parse_tool
- dry_run early return to avoid UnboundLocalError on repo.working_dir - guard against empty tool_entries in parse() to avoid IndexError - better error message that includes readme path and repo url
6612b45 to
a1d7665
Compare
|
Commits are now signed. The only remaining check is the e2e workflow, the entire workflow file is commented out so it fails immediately with 0s runtime. This is pre-existing and unrelated to this change. |
Fixes #814
Few small things I noticed in misc_tools_parser.py:
NamedTuplewas imported but never used anywhere in the file, removed itbooleanfromxmlrpc.clientis not the right type for a simple flag param, swapped it for Python's built-inboolmiscelaneous->miscellaneouslogging.error()was being called directly instead of going through the module-levellogger— standardized itprint()inside the loop replaced withlogger.info()to match the rest of the codebaseList[defs.Tool]type annotation toparse_toolreturn type andtool_entriesvariable, consistent with how other parsers in this directory are typedNo logic changes, just cleanup.