~ihabunek/annotatepy

c476ca72eaa495304f094234aff0095f6d62779e — Ivan Habunek 4 years ago 428b182
Switch order of checks

Makes for more sensible logging.
1 files changed, 5 insertions(+), 5 deletions(-)

M annotatepy/annotate.py
M annotatepy/annotate.py => annotatepy/annotate.py +5 -5
@@ 36,11 36,6 @@ def annotate_node(script, node, rel_path, project_root):
        return
    definition = definitions[0]

    if definition.module_name == 'builtins':
        # TODO: For Python builtin functions link to docs
        logger.debug(f"{str_node} skipped (builtin)")
        return None

    if not definition.module_path:
        # TODO: handle this
        logger.debug(f"{str_node} skipped (no module_path)")


@@ 52,6 47,11 @@ def annotate_node(script, node, rel_path, project_root):
        logger.debug(f"{str_node} skipped (instance)")
        return None

    if definition.module_name == 'builtins':
        # TODO: For Python builtin functions link to docs
        logger.debug(f"{str_node} skipped (builtin)")
        return None

    # Skip definitions outside of the project root
    if not definition.module_path.startswith(project_root):
        logger.debug(f"{str_node} skipped (outside of project root)")