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

Colons (:) in docstring drastically slow down darglint #198

Open
paw-lu opened this issue Jan 30, 2022 · 0 comments
Open

Colons (:) in docstring drastically slow down darglint #198

paw-lu opened this issue Jan 30, 2022 · 0 comments

Comments

@paw-lu
Copy link

paw-lu commented Jan 30, 2022

Using colons (:) in docstrings drastically slows down darglint—enough to make some linting sessions time out if there are enough arguments. This is unfortunate because rst uses : for cross-references.

For example, this simple function takes 2m2s to complete on my machine.

def foo():
    """Summary

    Args:
        file (Any):
            A path to a Jupyter Notebook file.
        theme (str): The theme to use for syntax highlighting. May
            be ``'ansi_light'``, ``'ansi_dark'``, or any
            `Pygments theme`_. By default ``'ansi_dark'``.
        plain (bool): Only show plain style. No decorations such as
            boxes or execution counts. If set to :py:data:`None`
            will autodetect. By default :py:data:`None`.
        unicode (Optional[bool]): Whether to use unicode characters
            to render the notebook. If set to :py:data:`None` will
            autodetect. By default :py:data:`None`.
        hide_output (bool): Do not render the notebook outputs. By
            default :py:data:`False`.
        nerd_font (bool): Use nerd fonts when appropriate. By
            default :py:data:`False`.
        files (bool): Create files when needed to render HTML
            content. By default :py:data:`True`.
        negative_space (bool): Whether render character images in
            negative space. By default :py:data:`True`.
        hyperlinks (bool): Whether to use hyperlinks. If
            :py:data:`False` will explicitly print out path. If set
            to :py:data:`None` will autodetect. By default
            :py:data:`None`.
        hide_hyperlink_hints (bool): Hide text hints of when content
            is clickable. By default :py:data:`False`.
        images (Optional[str]): Whether to render images. If set to
            :py:data:`None` will autodetect. By default
            :py:data:`None`.
    """
    ...

If I just remove the (extra) semicolons,

- :py:data:
+ pydata

Then it halves the time for the linting process (52s vs 2m2s).


Thanks for the great work here!

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

No branches or pull requests

1 participant