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

false positive D004 Found literal carriage return #78

Open
danieltuzes opened this issue Mar 9, 2022 · 6 comments
Open

false positive D004 Found literal carriage return #78

danieltuzes opened this issue Mar 9, 2022 · 6 comments

Comments

@danieltuzes
Copy link

I get false positive

D004 Found literal carriage return
at every line on Windows. It has been reported here first:
https://bugs.launchpad.net/doc8/+bug/1756704

@adam-grant-hendry
Copy link

Same here. Unfortunately, adding this to pyproject.toml:

[tool.doc8]
ignore = [ "D004" ]
max_line_length = 90

as suggested in #92 doesn't seem to ignore the warning for me in VSCode.

System Information

OS: Windows 10
Editor: VSCode 1.71.2
Python: 3.8
doc8: 0.11.2

@adam-grant-hendry
Copy link

As a temporary workaround in VSCode, you can manually change line endings for your .rst file from CRLF to LF and resave:

doc8_D004_tempfix

@adam-grant-hendry
Copy link

FYI, for those struggling with setting up the reStructuredText extension in VSCode, the extension's read-the-docs is helpful. It's a bit hidden on the extensions page, so I'm adding it here for reference.

Currently, I don't use doc8 since it only seems to warn for that don't affect me and rstcheck plus the live preview are sufficient for me. (Just one developer's two cents.)

@jfthuong
Copy link

jfthuong commented May 25, 2023

Add this in your settings.json file:

"restructuredtext.linter.doc8.extraArgs": [
        "--ignore D004"
    ]

And the warning D004 shall disappear (maybe after closing/re-opening or reloading the Window in order to refresh).

@12rambau
Copy link
Contributor

12rambau commented Jul 6, 2023

I see here people suggesting workarounds but would'nt it be better to have a solution so that the D004 error is stil tracked even for windows developer ?

@adamtheturtle
Copy link

I use the following in a .gitattributes file to avoid this issue and similar:

* text=auto eol=lf

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

Successfully merging a pull request may close this issue.

5 participants