You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linters have ways of specifying which files to run on (e.g. pycodestyle provides a --filename argument which can be specified at the command line or in a setup.cfg file; pydocstyle has a similar --match argument). However, when these tools are explicitly run against a specific file (instead of discovering files themselves), these arguments are ignored, and it seems that this is how VS Code invokes the linters.
Failing to honor these arguments adds noise to the linting results in VS Code. For example, pydocstyle will flag missing documentation in files with names starting with "test_", even though these are excluded by default when pydocstyle is run from the command line - this can easily add hundreds of unwanted "problems" to the Problems list.
To avoid this, there should be some mechanism to honor the file inclusion/exclusion configuration that each linter uses.
Extension version: 2018.10.1
VS Code version: Code 1.28.2 (7f3ce96ff4729c91352ae6def877e59c561f4850, 2018-10-17T00:23:51.859Z)
OS version: Windows_NT x64 10.0.17763
The text was updated successfully, but these errors were encountered:
@DonJayamanne That doesn't quite meet my needs; perhaps I should elaborate:
I have multiple linters enabled (pep8/pycodestyle and pydocstyle).
As per their defaults, I want pycodestyle to run on all .py files (even tests), but I only want pydocstyle to run on non-test .py files (I want tests to be written up to normal standards, but they don't need public documentation).
We have a CI setup that runs these tools and verifies that they pass before accepting the build. This uses the setup.cfg from my main directory to read the configuration of the linting tools.
I would like VS Code's "Problems" to be as aligned with the CI loop as possible. In both cases, nearly all configuration settings are read from the setup.cfg file and applied correctly; however, since the linters are run on a per-file basis the file matching rules are not applied in the same way.
With the current tooling, I can either choose to add an entry to the python.linting.ignorePatterns to exclude tests (in which case build-breaking pep8 style violations in test code will not be flagged as problems) or I can leave the setting as is (in which case I have hundreds of fictitious "problems" because our tests are not documented).
lockbot
locked as resolved and limited conversation to collaborators
Dec 18, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue Type: Feature Request
Linters have ways of specifying which files to run on (e.g.
pycodestyle
provides a--filename
argument which can be specified at the command line or in asetup.cfg
file;pydocstyle
has a similar--match
argument). However, when these tools are explicitly run against a specific file (instead of discovering files themselves), these arguments are ignored, and it seems that this is how VS Code invokes the linters.Failing to honor these arguments adds noise to the linting results in VS Code. For example, pydocstyle will flag missing documentation in files with names starting with "test_", even though these are excluded by default when pydocstyle is run from the command line - this can easily add hundreds of unwanted "problems" to the Problems list.
To avoid this, there should be some mechanism to honor the file inclusion/exclusion configuration that each linter uses.
Extension version: 2018.10.1
VS Code version: Code 1.28.2 (7f3ce96ff4729c91352ae6def877e59c561f4850, 2018-10-17T00:23:51.859Z)
OS version: Windows_NT x64 10.0.17763
The text was updated successfully, but these errors were encountered: