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

python.linting.ignorePatterns setting is not used #175

Closed
majutsushi opened this issue Apr 22, 2023 · 5 comments
Closed

python.linting.ignorePatterns setting is not used #175

majutsushi opened this issue Apr 22, 2023 · 5 comments
Labels
question Asking for support or clarification

Comments

@majutsushi
Copy link

It would be really useful if the python.linting.ignorePatterns VS Code setting would be honoured by this extension. This would make it easy to for example exclude standard library modules from the analysis that would otherwise pollute the problem list if you ever jump to them.

Of course you can configure exclude paths in pyproject.toml, but you would have to do that for each project individually, and in cases where you edit stand-alone scripts you wouldn't even have a project file.

If both these VS Code patterns and excludes in the pyproject.toml are configured I would suggest using both. This means people can have their own excludes configured for a shared project, and if their normal excludes are undesirable for a specific project they can always set the patterns to a different value in their workspace settings.

@charliermarsh
Copy link
Member

Oh interesting, I didn’t know about this setting. On the surface, I agree with you, though I’d like to see if / how other similar extensions handle them before committing.

@charliermarsh
Copy link
Member

It looks like the other Python extensions don't respect this, but there's a recently-opened issue (microsoft/vscode-flake8#147) discussing it.

@charliermarsh charliermarsh added the question Asking for support or clarification label Apr 22, 2023
@majutsushi
Copy link
Author

majutsushi commented Apr 23, 2023

There was some recent discussion in the pylance project about how this setting is meant for linters: microsoft/pylance-release#4100

Here's the same feature request for the pylint extension: microsoft/vscode-pylint#199
According to that issue the setting is honoured when using the system pylint but not when using the extension, although I'm not sure if the former is still true after the pylance change discussed above. I do remember making use of that setting when using pylint (without the extension) in the past, so I was surprised at suddenly getting lots of errors in system files when I started using ruff.

@cnpryer
Copy link

cnpryer commented Apr 23, 2023

Imo this does seem like a nicer way to do it than to have configuration for each extension.

I'm not familiar with how these extensions are built, but it seems like there are varying levels of support. Is the intention behind python.linting.ignorePatterns to have linters respect its ignore?

I also read about some other extensions utilizing (i think) the python.linting.cwd to manage in/vs out of the project. If astral-sh/ruff-lsp#99 works out it'd be an improvement on what's currently possible.

@charliermarsh
Copy link
Member

Ok, it looks like this setting is considered legacy, and they plan to deprecate it: microsoft/vscode-flake8#147 (comment).

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for support or clarification
Projects
None yet
Development

No branches or pull requests

3 participants