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

Docstring errors reported on the line after the comment in certain cases #2973

Closed
Xoriun opened this issue Jun 13, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@Xoriun
Copy link

Xoriun commented Jun 13, 2024

What's wrong

Errors for single-line docstrings of decorated functions are not reported on the line of the docstring but rather on the line after the docstring.

def some_deco():
    """a."""
    return 1


@some_deco
def test():
    """b."""
    return 2

With this I get two errors, one DAR201 (missing return in docstring) in line """a.""" (as expected) and another DAR201 in line return 2 (not as expected)

How it should be

I would expect the seconds error to be on the line """b.""".

Flake8 version and plugins

{
"platform": {
"python_implementation": "CPython",
"python_version": "3.12.3",
"system": "Windows"
},
"plugins": [
{
"plugin": "darglint",
"version": "1.8.1"
},
{
"plugin": "flake8-bandit",
"version": "4.1.1"
},
{
"plugin": "flake8-broken-line",
"version": "1.0.0"
},
{
"plugin": "flake8-bugbear",
"version": "24.4.26"
},
{
"plugin": "flake8-commas",
"version": "2.1.0"
},
{
"plugin": "flake8-comprehensions",
"version": "3.14.0"
},
{
"plugin": "flake8-debugger",
"version": "4.1.2"
},
{
"plugin": "flake8-docstrings",
"version": "1.7.0"
},
{
"plugin": "flake8-eradicate",
"version": "1.5.0"
},
{
"plugin": "flake8-isort",
"version": "6.1.1"
},
{
"plugin": "flake8-quotes",
"version": "3.4.0"
},
{
"plugin": "flake8-rst-docstrings",
"version": "0.3.0"
},
{
"plugin": "flake8-string-format",
"version": "0.3.0"
},
{
"plugin": "mccabe",
"version": "0.7.0"
},
{
"plugin": "pep8-naming",
"version": "0.13.3"
},
{
"plugin": "pycodestyle",
"version": "2.11.1"
},
{
"plugin": "pyflakes",
"version": "3.2.0"
},
{
"plugin": "wemake-python-styleguide",
"version": "0.19.2"
}
],
"version": "7.0.0"
}

pip information

pip 24.0 from C:\Users\Praktikant\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip (python 3.12)
aiofiles==23.2.1
altgraph==0.17.4
anyio==4.4.0
astor==0.8.1
attrs==23.2.0
Babel==2.15.0
bandit==1.7.9
certifi==2024.6.2
chardet==5.2.0
charset-normalizer==3.3.2
ci-info==0.3.0
click==8.1.7
colorama==0.4.6
configobj==5.0.8
configparser==7.0.0
darglint==1.8.1
docutils==0.21.2
eradicate==2.3.0
etelemetry==0.3.1
filelock==3.14.0
fitz==0.0.1.dev2
flake8==7.0.0
flake8-bandit==4.1.1
flake8-broken-line==1.0.0
flake8-bugbear==24.4.26
flake8-commas==2.1.0
flake8-comprehensions==3.14.0
flake8-debugger==4.1.2
flake8-docstrings==1.7.0
flake8-eradicate==1.5.0
flake8-isort==6.1.1
flake8-quotes==3.4.0
flake8-rst-docstrings==0.3.0
flake8-string-format==0.3.0
frontend==0.0.3
future==1.0.0
h11==0.14.0
httplib2==0.22.0
idna==3.7
iso8601==2.1.0
isodate==0.6.1
isort==5.13.2
itsdangerous==2.2.0
looseversion==1.3.0
lxml==5.2.2
markdown-it-py==3.0.0
mccabe==0.7.0
mdurl==0.1.2
networkx==3.3
nibabel==5.2.1
nipype==1.8.6
numpy==1.26.4
packaging==24.0
pandas==2.2.2
pathlib==1.0.1
pbr==6.0.0
pefile==2023.2.7
pep8-naming==0.13.3
pillow==10.3.0
prov==2.0.0
pycodestyle==2.11.1
pydocstyle==6.3.0
pydot==2.0.0
pyflakes==3.2.0
Pygments==2.18.0
pyinstaller==6.8.0
pyinstaller-hooks-contrib==2024.7
PyMuPDF==1.24.5
PyMuPDFb==1.24.3
pyparsing==3.1.2
pyserial==3.5
python-dateutil==2.9.0.post0
pytz==2024.1
pywin32-ctypes==0.2.2
pyxnat==1.6.2
PyYAML==6.0.1
rdflib==7.0.0
reportlab==4.2.0
requests==2.32.3
restructuredtext-lint==1.4.0
rich==13.7.1
scipy==1.13.1
setuptools==70.0.0
simplejson==3.19.2
six==1.16.0
sniffio==1.3.1
snowballstemmer==2.2.0
starlette==0.37.2
stevedore==5.2.0
traits==6.3.2
typing_extensions==4.12.2
tzdata==2024.1
urllib3==2.2.1
uvicorn==0.30.1
wemake-python-styleguide==0.19.2

OS information

Windows 10 Pro, Version 10.0.19045 Build 19045

@Xoriun Xoriun added the bug Something isn't working label Jun 13, 2024
@sobolevn
Copy link
Member

DAR is now removed.

@sobolevn sobolevn closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants