PrincetonUniversity / blocklint

MIT License
7 stars 7 forks source link

Support single-line ignore for docstrings #20

Closed pacrob closed 5 months ago

pacrob commented 6 months ago

Given a docstring that contains a blocked word:

def my_func():
"""
Function that does stuff. More detail at:
https://github.com/repo/that/still/uses/master/file.md
Returns: other stuff
"""

Other linting tools, such as mypy or flake8, allow the # ignore: to be placed after the closing """ so as to not mess with the docstring.

Current solutions are to put the # blocklint... on the same line, which won't work because it shows up in docs, or to ignore the whole file, which misses any future additions.

Please add support for single-line ignore to be placed after a multi-line docstring.

troycomi commented 6 months ago

I like this idea but don't have time to implement. I'd be open to any PRs.