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

doc8 warns "D001 Line Too Long" #83

Closed
dbc60 opened this Issue Mar 15, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@dbc60
Copy link

dbc60 commented Mar 15, 2018

Hi I've run into a new problem with the restructuredtext extension. Here's the information about it.

Environment

  • Extension version: 53.0.0
  • Visual Studio Code version: 1.21.0
  • Operating System version: Windows 10
  • Python version: Python 3.5.3 :: Anaconda custom (64-bit)
  • sphinx version: Sphinx (sphinx-build) 1.6.3
  • A sample of conf.py or its important fragments:
extensions = ['sphinx.ext.todo',
    'sphinx.ext.mathjax',
    'sphinx.ext.viewcode',
    'sphinx.ext.githubpages']

templates_path = ['_templates']
source_suffix = '.rst'

Expected behavior
No green squiggly lines, and no warnings about lines being too long.

Actual behavior
Nearly every paragraph and list entry is underlined with a green squiggle. Mousing over those lines shows the doc8 warning [restructuredtext-lint] D001 Line Too Long. The text was fine before doc8 was the linter.

Note: when I opened vscode to edit my reStructuredText documents, I was seeing an error about Python not being able to find doc8.main. That's when I discovered you changed the linter, so I installed doc8.

Perhaps I installed an unsupported version? Just in case, here's the output of installing doc8:

C:\> pip install doc8
Collecting doc8
  Downloading doc8-0.8.0-py2.py3-none-any.whl
Collecting stevedore (from doc8)
  Downloading stevedore-1.28.0-py2.py3-none-any.whl
Requirement already satisfied: chardet in e:\local\anaconda3\lib\site-packages (from doc8)
Requirement already satisfied: six in e:\local\anaconda3\lib\site-packages (from doc8)
Requirement already satisfied: docutils in e:\local\anaconda3\lib\site-packages (from doc8)
Requirement already satisfied: restructuredtext-lint>=0.7 in e:\local\anaconda3\lib\site-packages (from doc8)
Collecting pbr!=2.1.0,>=2.0.0 (from stevedore->doc8)
  Downloading pbr-3.1.1-py2.py3-none-any.whl (99kB)
    100% |################################| 102kB 853kB/s
Installing collected packages: pbr, stevedore, doc8
Successfully installed doc8-0.8.0 pbr-3.1.1 stevedore-1.28.0

Detailed Steps to reproduce the problem
Open a reStructuredText document in vscode.

Thank you in advance for any help you can provide.

@lextm

This comment has been minimized.

Copy link
Member

lextm commented Mar 15, 2018

doc8 checks line length, and recommends the maximum to be 79 characters.

You have several ways to change the behavior.

  • --max-line-length int switch can be used and you can specify a integer value you like instead of 79.
  • --ignore D001 switch can be used to suppress the warning.

Such extra switches can be passed to doc8 by adding restructuredtext.linter.extraArgs to your settings file, such as

{
    "restructuredtext.linter.extraArgs": [
        "--ignore D001"
    ]
}

@lextm lextm added the question label Mar 15, 2018

@dbc60

This comment has been minimized.

Copy link
Author

dbc60 commented Mar 15, 2018

Thank you so much for the response. I didn't know about restructuredtext.linter.extraArgs. Where is that documented? I'll give it a try this weekend - unfortunately, I can't try it out sooner.

@lextm lextm referenced this issue Mar 18, 2018

Closed

Warnings D002 and D004 at every single line #84

5 of 6 tasks complete

@lextm lextm closed this Mar 18, 2018

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