-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Put flake8 behind LSP #17235
Comments
Did some initial investigation and looks like we have to discuss some UX when it comes to getting linters on user machine. Things to discuss:
|
We have a prototype for flake8 behind LSP that adds ability to control severity by error code. Instructions to get it and use it are here: PyCQA/flake8#1467 (comment) |
@karthiknadig @brettcannon I see the new extension has exactly the same problem as the current built-in implementation - What's the actual use-case? All the tools like It's extremely annoying attitude, but anyway - there's a solution for that: |
@jaklan We have not manually added any restriction to |
@karthiknadig the problem is it's not passed to What determines the value of |
You can see the entire source code in the extension directory. It should be under You are missing the point of this exercise. This issue and the prototype were created to look at how linting over LSP will look like and what we want to do about the ownership of the LSP part and the extension part. Feedback is definitely welcome, but I don't want that to detract from the actual discussion. We designed this specifically with python community in mind. So, most of the real work in the python code. We don't do anything other than hooking up the LSP in the TS code. You should be able to change anything, detect any additional paths, change environment variables, multiplex multiple linters, or literally anything else from the python code. As long as the messages between VS Code and |
@karthiknadig I understand the goal, but in the flake8 repository you just mentioned this thread as a place to share feedback about the PoC, so I thought it's worth to mention this problem as it's also related to the new extension, but ofc I can create a separate issue for that, whatever you prefer 😉 Yes, I was reading the code of both old and new linter implementation, but I'm just still missing the one thing I mentioned above - |
@jaklan all of our work will end up being open source, so if you want an extension for |
@brettcannon sure, but if it's only a matter of specifying the name of the executable then there's no sense to create an additional extension doing exactly the same. @karthiknadig yeah, I was referring to the old extension above, sorry for the confusion. Regarding the new one - I still have some strange issues with
{
"python.linting.flake8Enabled": false,
"python.flake8Path": [
"flake8"
]
}
I have verified the
so it seems the venv is not taken into account (== not added to the |
@jaklan If you have a python virtual environment with With the prototype extension For now, the server is just using exec instead of shell exec (which will allow activated launches). we avoided those to reduce load times. some scenarios the activation time for environments can exceed 30 seconds. |
@karthiknadig okay, so we have a different logic for using Just out of curiosity - if activating the venv would be problematic for the |
In the module scenario we are not activating. we are directly launching There is another way, launch vscode from an activated terminal. Also, note once we create a repository for the prototype, community can make suggestions. IF the community feels that the LSP should run from an activate environment then we may do that. Again, the point of this whole thing was that it is going to be easier to make contribution because most of the code will sit in python, with TS part just doing the LSP hook up. |
@karthiknadig sure, waiting for the official release then to re-raise the issue, thanks for all the explanations, looking forward to contribute! |
See what it will take to put the linters behind LSP. As a part of the experiment put
flake8
behind LSP.The text was updated successfully, but these errors were encountered: