2014-01-29 57 views
2

我嘗試使用autopep8來設置一些python代碼的格式,期望80個字符以上的註釋行將被拆分等等。我用這個測試文件test.py,其中只包含註釋:Autopep8不打破長評論行?

#asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 
#asdf asdf asdf asdf 
#asdf asdf asdf asdf 

#asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 
#asdf asdf asdf asdf 
#asdf asdf asdf asdf 
#asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 

我然後跑autopep8 test.py

這給出了以下的輸出:

# asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 
# asdf asdf asdf asdf 
# asdf asdf asdf asdf 

# asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 
# asdf asdf asdf asdf 
# asdf asdf asdf asdf 
# asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 
# asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 

最後長線被分割,但前兩個不是。我認爲所有的行應該被打破在80個字符寬。我究竟做錯了什麼?

+0

我在OS X 10.8.5上使用Python 2.7.6,autopep8 0.9.7和pep8 1.4.6。我在Ubuntu 12.04.3 LTS上得到了相同的結果。 –

回答