I tried using autopep8 to format some python code, expecting that comment lines above 80 characters would be split up, among other things. I used this test file test.py
, which only consists of comments:
#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
I then ran autopep8 test.py
This gives the following output:
# 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
The last long line is split, but the first two aren't. I think all the lines should be broken at 80 characters wide. What am I doing wrong?
autopep8 doesn't automatically fix all long lines; it only does it in cases where it's deemed 'safe'. See: https://github.com/hhatto/autopep8/issues/39
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With