Question: autopep8 (pycodestyle) formatter not respecting configuration file
See original GitHub issueUsing:
$ 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:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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. 😃
@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.