Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible bugs in logging #225

Closed
danieleades opened this issue Apr 11, 2021 · 1 comment
Closed

possible bugs in logging #225

danieleades opened this issue Apr 11, 2021 · 1 comment

Comments

@danieleades
Copy link
Contributor

@danwos there's a couple of suspect logging calls-

sphinxcontrib.needs.directives.needflow.split_link_types:

def split_link_types(link_types: str) -> Iterable[str]:
    def is_valid(link_type) -> bool:
        if len(link_type) == 0 or link_type.isspace():
            logger.warning(
                "Scruffy link_type definition found in needflow {}. "
                "Defined link_type contains spaces only.".format(id)
            )
            return False
        return True

    return filter(
        is_valid,
        (x.strip() for x in re.split(";|,", link_types)),
    )

the format string uses the parameter id, but this variable doesn't appear to be in scope. an IDE won't complain, because there is a built-in function with the same name that is in scope. Is this a bug?

it's also present in 2 other places - `

  • sphinxcontrib.needs.directives.need.NeedDirective.read_in_links
  • sphinxcontrib.needs.diagrams_common.DiagramBase.collect_diagram_attributes
@danwos
Copy link
Member

danwos commented Apr 15, 2021

Yes that are bugs and can be fixed.
Do you want to do it?

danwos added a commit that referenced this issue Apr 20, 2021
danwos added a commit that referenced this issue Apr 20, 2021
@danwos danwos closed this as completed in 0b65e01 Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants