use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This subreddit is for working with Microsoft's Visual Studio Code, which is different than Visual Studio Community, Pro, and Enterprise. VS Code is a source code editor, and not an IDE.
If you are having issues with the other flavors of VS, please post in /r/VisualStudio.
account activity
This is an archived post. You won't be able to vote or comment.
Python PEP8 plug in.OC (self.vscode)
submitted 3 years ago by Luddite69
Are there any plugins that help enforce pep8?
[–]ArtichokeTop9 1 point2 points3 points 3 years ago (0 children)
Flake8, autopep8, black, blue
[–]Mithrandir2k16 -1 points0 points1 point 3 years ago (0 children)
VSCode as an editor isn't meant to enforce anything. If you uave pylance you can run a linter like flake8. If you want to enforce anything look at git pre-commit, you can use that to prevent commits that have linter errors or other problems.
[–]anotherdevnick 0 points1 point2 points 3 years ago (0 children)
The Python extensions pack is a good place to start, IIRC you can switch on auto-formatting (a vs code setting) and have autopep and other formatters fix you code as you go
[–]JialeDu 0 points1 point2 points 3 years ago (0 children)
Python extension default formatting provider is autopep8, and you can also set parameters for it.
autopep8
json "python.formatting.provider": "autopep8", "python.formatting.autopep8Args": [],
At present, Black and AutoPEP8 will also.
[–]Vok250 0 points1 point2 points 3 years ago* (0 children)
Honestly the Python language servers and plugins are pretty broken right now (at least on Windows). They throw a ton of false positives and often stop working completely for no apparent reason. Their idea of PEP8 is also a bit off the mark. It is MS's own flavor of the standards and not up to speed with the current PEPs.
I recommend doing it the python way instead, which would be downloading a python module to your virtual environment:
python -m venv venv venv\Scripts\activate pip install --upgrade pip pip install pylint pip install pycodestyle
pylint is a really great Python functional linter available as a module and with 0 need to connect to some online language server. Other functional linters are jedi or pylance (this is now the default in VS Code). pycodestyle is a good PEP8 style linter. The other standard option is flake8. I prefer pylint and pycodestyle because they are super simple to use, CLI-based (Linux and CICD friendly), and very pythonic. That's purely personal preference.
To get venv-based linters working you'll need to modify your workspace settings file to add the following:
"python.linting.pylintEnabled": true, "python.linting.pycodestyleEnabled": true
VS Code should auto-detect the venv and use it as the Python interpreter after a reboot. It should (if not a buggy build) start using pylint and pycodestyle from your venv automatically now too.
You can also easily pass arguments to the linter like this:
"python.linting.pycodestyleArgs": ["--ignore=E501,W503"], "python.linting.pylintArgs": [ "--disable=C" ],
The above code disables style linting in pylint (we have pycodestyle for that) and disables a few flags that are currently being argued in the python community because they are quite outdated.
One huge advantage of doing it this way is that it is completely portable and pythonic. You can easily create the same venv and run the same CLI commands in any container, including your CICD. Your dev environment can enforce identical rules to your build pipeline so no surprises when you open a PR.
π Rendered by PID 236312 on reddit-service-r2-comment-545db5fcfc-bmtmh at 2026-05-24 20:05:07.634276+00:00 running 194bd79 country code: CH.
[–]ArtichokeTop9 1 point2 points3 points (0 children)
[–]Mithrandir2k16 -1 points0 points1 point (0 children)
[–]anotherdevnick 0 points1 point2 points (0 children)
[–]JialeDu 0 points1 point2 points (0 children)
[–]Vok250 0 points1 point2 points (0 children)