Skip to content

Spellchecker doesn't ignore labels and types in autodoc docstrings #10187

Open
@avylove

Description

Current problem

There are a few styles of these (Google, Numpy) but the project I'm working on uses a style like this. I guess this would be Sphinx style?

def func(argname1, argname2):
    '''
    :arg str argname1: Description of `argname1`
    :arg int OrderedDict: Description of `argname2`

    :rtype: str
    :returns: Description of return value.
    '''
    ...

arg, rtype, str all come up as spelling errors. Interestingly OrderedDict doesn't unless I specify it as collections.OrderedDict

The current workaround it to add these to the ignored words list or private dictionary, but that can potentially lead to masking other spelling errors. The bigger issue is this creates resistance to using the spell checker, especially with those who aren't used to it.

Desired solution

The spell checker should be able to recognize these cases and ignore them, but not ignore the the description text to the right. Potentially this could be configurable like spelling-ignore-comment-directives, but these styles don't change at the frequency of new tools being introduced.

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Enhancement ✨Improvement to a componentNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Spellchecker doesn't ignore labels and types in autodoc docstrings · Issue #10187 · pylint-dev/pylint