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

Any interest in owning a flake8 extension for VS Code? #1467

Closed
brettcannon opened this issue Nov 16, 2021 · 12 comments
Closed

Any interest in owning a flake8 extension for VS Code? #1467

brettcannon opened this issue Nov 16, 2021 · 12 comments

Comments

@brettcannon
Copy link

brettcannon commented Nov 16, 2021

For the Python extension for VS Code, we are embarking on redoing our tool support as separate extensions (using LSP for a better experience than what we currently provide). One of those tools is flake8, and before we publish a standalone flake8 extension we wanted to see if you had any interest in owning the flake8 extension?

We already have a prototype mostly working and expect to finish the work before the end of the year, but since transferring ownership on the VS Code Marketplace is a pain and some projects like owning their editor experience, we thought we would ask first if you had any interest in owning the extension as a courtesy before we published anything (we would give you the working code we have if you wanted it)? There's no expectations here and we are fully prepared to create and own the extension if you are not interested in this.

@asottile
Copy link
Member

what would the maintenance look like -- I don't think either of us are really well equipped to take on a typescript project to maintain this -- if the microsoft python team is comfortable maintaining it for now that seems fine

@brettcannon
Copy link
Author

We are actually planning on using this extension to develop a (cookiecutter | GH repo) template for Python-based extensions that will minimize the amount of TypeScript you have to write to zero; our prototype only requires editing JSON (package.json), anything special necessary on the language server side (which is entirely Python), and appropriate tests (which would be run by pytest).

If you're more comfortable with us starting with ownership we can. Ownership transfers of extensions are doable with effort, so this won't close a door on anything. Basically if you have any reservations I would rather keep it on our side and have you provide feedback/guidance on the experience so no one feels pressured to do anything.

Another option is to work with you on developing an LSP interface for flake8 and then we simply wrap that in a VS Code extension. That way more editors can benefit from the work directly. That could be in flake8 directly or a separate package, whatever you prefer.

Or you can just see how it turns out with our initial work and then come back to us to talk about breaking out the LSP bit if that's a part you would like to own as that's easy to separate out later. If you think that might interest you we can make sure to not publish anything to PyPI until we make our first extension release and talk to you about the resulting implementation.

@asottile
Copy link
Member

yeah probably best for it to be done externally for now and we can circle back at a later time

@karthiknadig
Copy link

@asottile We are further along in the process of building linting over language server protocol. Here is a prototype of the extension if you can try, to get an idea of what we are planning. You can download it, extract the .vsix file, and then install the VSIX to try it out.

Please try this out with python 3.10, the extension is bundled with flake8 4.0.1 (you should not have to install flake8):
python-flake8.zip

For some code like this:

import unittest
import re

class TestSum(unittest.TestCase):

    def test_sum(self):
        self.assertEqual(sum([10, 20, 30]), 60, "Should be 60")

    def test_sum_tuple(self):
        self.assertEqual(sum((10, 20, 30)), 60, "Should be 60")

if __name__ == '__main__':
    unittest.main()

you should see:
image

@asottile
Copy link
Member

@karthiknadig bundling flake8 concerns me -- users will expect that the version they're using in their terminal will match what's run in their editor

@brettcannon
Copy link
Author

The shipped version is only a fallback for users who don't have flake8 already installed (i.e. beginners who are just trying to get going and have been told to "use flake8").

@asottile
Copy link
Member

one thing to note, I see that there are different icons for F/E/W -- these don't actually indicate failure, error, or warning -- they are just prefixes for codes. they should all display at the "error" level probably

@karthiknadig
Copy link

@asottile That can be configured using the python.flake8Severity setting. We have people requesting control over what icons are shown see here microsoft/vscode-python#18261

This is the default setting:

"python.flake8Severity": {
    "E": "Error",
    "F": "Error",
    "I": "Information",
    "W": "Warning"
}

The above extension allows you to control it further:

    "E": "Error",
    "F": "Error",
    "I": "Information",
    "W": "Warning",
    "E501": "Warning"
}

@asottile
Copy link
Member

please set them all to Error by default, and I is not a code provided by flake8 by default

@sigmavirus24
Copy link
Member

Yeah the I prefix is shared by a few plugins iirc and can not be reliably classified one way or another. If error is too severe, making everything a warning would be more sensible

@jaklan

This comment was marked as off-topic.

@sigmavirus24
Copy link
Member

@jaklan It saddens me you've chosen to attack @asottile personally for a stance they didn't choose.

When pyproject.toml was announced, I was immediately against it. I argued against during discussions of the PEP against the file format for it's connection to a sexual harasser. I've been against incorporating it in Flake8 and supported projects for refusing to integrate it loudly.

Regardless, you receive Flake8 without any guarantee or promise of support or specific features. And your behaviour here is enough for me to choose to ensure you don't conduct personal attacks against anyone else in any other org I work on or control. I hope your outburst was worth it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants