question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: autopep8 (pycodestyle) formatter not respecting configuration file

See original GitHub issue

Using:

$ autopep8 --version
autopep8 1.4.4 (pycodestyle: 2.5.0)

I have a .flake8 (also tried setup.cfg) with a section like so:

[flake8]
exclude=path/to/some/file

I’ve also tried with [pep8] or [pycodestyle] as per https://github.com/hhatto/autopep8

The Python VS Code extension does not work with any of these, as the formatter anyway formats the files. I have not set any of the python.formatting. options so it should default to using autopep8.

Why is this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ericsnowcurrentlycommented, Jul 16, 2019

Sounds good. Feel free to open that enhancement request for the extension, but I’d give it a low chance of actually happening. Still, even a closed issue is a signal of interest that others might share. 😃

0reactions
thernstigcommented, Jul 16, 2019

@ericsnowcurrently Thank you, I think we can close this then. Since the option to set --global-config already exists for the Python extension (via "python.formatting.autopep8Args": [...) then I think that might be enough. If you yourself believe the the Python extension automatically should look in the root for any of the mentioned files, let me know and I will open an ehchancement request.

I will try to open an issue on autopep8 to see if they can implement this as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python AutoPep8 formatting not working with max line length ...
Currently, I have to indent big lines manually. Is there any other format apart from pep8 which supports 119 characters and indent lines...
Read more >
autopep8 - PyPI
A tool that automatically formats Python code to conform to the PEP 8 style guide.
Read more >
vscode autopep8 config file - Kuchi Salon
Here are some solutions that worked for me. When I run the >autopep8 command I get error: Error: Command failed: autopep8 ...
Read more >
Editing Python in Visual Studio Code
Specifies the formatter to use, either "autopep8", "yapf", or "black". Formatter-specific settings. The following settings apply to the individual formatters.
Read more >
Introduction — pycodestyle 2.10.0 documentation
ini file is read if present. If none of these files have a [pycodestyle] section, no project specific configuration is loaded. Error codes ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found