我有一个文件test.py
,其中包含以下代码
class MyClass():
y = 2
def my_func(self):
x = 2
return(x)
运行pycodestyle test.py
时我会得到
test.py:2:1: E112 expected an indented block
test.py:2:1: E305 expected 2 blank lines after class or function definition, found 0
test.py:3:1: E302 expected 2 blank lines, found 0
test.py:4:1: E112 expected an indented block
test.py:4:1: E305 expected 2 blank lines after class or function definition, found 0
但是运行autopep8 test.py
不能解决任何缩进问题。它返回
class MyClass():
y = 2
def my_func(self):
x = 2
return(x)
我希望它会返回
class MyClass():
y = 2
def my_func(self):
x = 2
return(x)
我期望autopep8
太多吗?