ruff
ruff copied to clipboard
Support and Integration for VSCode
Is there a way to add ruff as a python linter in VScode?
If the maintainers decide that editor integration is in scope for this project rather than separate dedicated projects, I would like to suggest using Language Server Protocol for this to allow usage with many editors at once (editors that support it include: Visual Studio, Visual Studio Code, Neovim, Sublime Text, JetBrains Fleet, and more): https://microsoft.github.io/language-server-protocol/
I think @jack1142 made a good suggestion here. I just researched a little, and integrating ruff
as a linter in VSCode is not trivial. The best way is to create a PR for the official Python extension. It doesn't look too complicated, but I am also not sure if they are willing to support a new, not fully stable linter.
As a Neovim user, I am happier with a LSP, which is easily integrable. I might take a look at it.
VS Code Python team is actually pushing for this as well (LSP-based integrations, not necessarily the linter themselves implementing language server protocol themselves), they're working on extension templates and stuff like that to make it easy to create new integrations for linters with hopefully no TypeScript knowledge required (unlike the current solution which does require that). Considering that a lot of this is still being worked on, it might not make sense to work on VS Code specific extension just yet. LSP is generic enough that it's likely that not much will be needed to make a VS Code specific extension for it in the future.
Here are a bunch of related issues:
- https://github.com/psf/black/issues/2883
- https://github.com/PyCQA/isort/issues/1904
- https://github.com/PyCQA/pylint/issues/5796
- https://github.com/PyCQA/flake8/issues/1467