Open benjaminjkraft opened 6 years ago
Hi,
Now how do you specify options and if you change, for example, what options should I have?
For my purposes any of the following would work great:
--pycodestyle-only
, that says to only do things that pycodestyle requires.--ignore
which is what I am doing as a workaround, or better add them to the repo's .flake8
-- this is how other options are specified in this repo)autopep8 is correcting according to pycodestyle's error codes. Currently there are some to fix with lib2to3.
all of the features where autopep8 goes beyond what pycodestyle requires.
Specifically, what kind of correction is it? I would appreciate it if you have code examples.
The corrections I refer to are the ones here: https://github.com/hhatto/autopep8/blob/master/autopep8.py#L187 which are using the same error code as pycodestyle but making different changes.
Here's a sample file:
# test.py
class Foo:
"""docstring"""
def bar(self):
pass
Running flake8 test.py
returns no warnings, but autopep8
still tries to make changes:
$ autopep8 -d test.py
--- original/test.py
+++ fixed/test.py
@@ -1,5 +1,6 @@
# test.py
class Foo:
"""docstring"""
+
def bar(self):
pass
It would be nice to have an option to disable all of the features where
autopep8
goes beyond whatpycodestyle
requires. This is useful for avoiding spurious diffs when operating on existing codebases which don't necessarily follow those rules. Right now, they can only be disabled by disabling all theE301
/E303
fixes, which is unfortunate.