-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
pydocstyle's default --match option should be honored #494
Comments
@fannheyward It is pydocstyle, but apparently it is not excluded if you pass the file as absolute or relative path.
REF?:
Fix?: In my environment, I confirmed that it worked fine by passing the file name as is. https://github.com/fannheyward/coc-pyright/blob/master/src/linters/pydocstyle.ts#L12 const messages = await this.run([path.basename(Uri.parse(document.uri).fsPath)], document, cancellation); (If the this issue has already been solved, you can ignore it.) |
@yaegassy yes, you're right, this fix won't work. |
This PR has nothing to do with anything. I'm sorry for the noise. |
Use file name is incorrect, for example: main.py
test
test/__init__.py
test/m.py
test/test_m.py
|
@fannheyward Isn't it a problem that can be solved by passing the "file name" instead of the "file path"? Fix (Idea): const messages = await this.run([path.basename(Uri.parse(document.uri).fsPath)], document, cancellation); |
@yaegassy "file name" is not ok. |
@fannheyward Oh... that's exactly how it should behave... :( |
@yaegassy my example maybe misleading. For example:
If we use "file name", |
The key problem is |
Fix: run |
@fannheyward I've tried this commit: d4b3e3b It seems to run recursively when you pass the directory, so it may take too long to complete for large projects. In some cases, the pydocstyle process might stay up for a very long time. For example, if you run it on a python file directly under the root of the project, it will be executed on all python files in the project. |
@yaegassy good catch. |
Check filename with |
@fannheyward for me this does not work, it seems it just excludes all. |
What's the output of
:CocCommand pyright.version
[coc.nvim] coc-pyright 1.1.141 with Pyright 1.1.142
By default pydocstyle does not check file names starting with
test_
for docstrings. Runningpydocstyle
from shell confirms this. However, I still see missing docstring warnings while working on my test files. I could disable linting altogether for test files, or disable pydocstyle while writing tests, but both are inconvenient.Ideally, there should be a way to specify arguments passed tothere is.pydocstyle
Is this an issue with the upstream, or can this be handled within coc-pyright?
edit: Appearently, there is an option for that:
"python.linting.pydocstyleArgs": [ "--match='(?!test_).*\\.py" ]
(notice the double \ because coc complained about invalid escape character.) Should this option have a default value that reflects that of the standalonepydocstyle
?The text was updated successfully, but these errors were encountered: