hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.
https://pypi.org/project/autopep8/
MIT License
4.56k stars 288 forks source link

How to list the active fixes? #667

Open luzfcb opened 1 year ago

luzfcb commented 1 year ago

Hello, first, thanks for the hard work on this project.

I'm trying to figure out what exactly are the fixes that autopep8 applies by default, and what are the fixes that autopep8 will use when for example, a project has multiple configuration files with sections that define select and ignore.

for example, running autopep8 --list-fixes shows that there are options W291, W292, W293, W391

now let's assume I have two config files:

.flake8:

[flake8]
select = W29,W39

setup.cfg

[pycodestyle]
ignore = W292

let's assume that there is an optional argument called --active-only

autopep8 --list-fixes --active-only

The output would be something like:

W291 - Remove trailing whitespace.
W293 - Remove trailing whitespace.
W391 - Remove trailing blank lines.

if I also include --aggressive and --experimental like:

autopep8 --list-fixes --active-only -aaa --experimental

The output will show W291, W293, W391, and the other fixes that autopep8 applies when aggressive and experimental are used.

In other words, is there any way to get the list of active fixes after autopep8 loads all configuration files?

luzfcb commented 1 year ago

@hhatto Do you have any thoughts?