wistful / SublimeAutoPEP8

Automatically formats Python code to conform to the PEP 8 style guide using autopep8 and pep8 modules
144 stars 23 forks source link

[Bug] E305 doesn't fix #53

Closed Kristinita closed 6 years ago

Kristinita commented 6 years ago

1. Summary

E305 error don't fix in SublimeAutoPEP8, but fix, if I use autopep8 CLI.

2. Settings

2.1. Environment

Operating system and version: Windows 10 Enterprise LTSB 64-bit EN Sublime Text: Build 3143 Python: 3.6.3 autopep8 CLI: 1.3.3 Package: The latest stable version of SublimeAutoPEP8 for Sublime Text 3

2.2. Example file

My example file SashaIsTheWorld.py:

def sasha_function():
    print("Sasha is the World!")

sasha_function()

3. Steps to reproduce

I reproduce the problem in a version of Sublime Text without plugins and user settings.

I install SublimeAutoPEP8 via Package Control → I restart Sublime Text → I open SashaIsTheWorld.pyCtrl+Shift+P (⌘⇧p for Mac) → AutoPEP8: Format Code.

4. Expected behavior

If I use autopep8 CLI:

D:\SashaPythonista>flake8 SashaIsTheWorld.py
SashaIsTheWorld.py:4:1: E305 expected 2 blank lines after class or function definition, found 1

D:\SashaPythonista>autopep8 --in-place SashaIsTheWorld.py

D:\SashaPythonista>flake8 SashaIsTheWorld.py

D:\SashaPythonista>
def sasha_function():
    print("Sasha is the World!")

sasha_function()

5. Actual behavior

I see in status bar:

AutoPep8: No issues to fix

No issues to fix

6. Not helped

I don't find, how I can fix E305, in SublimeAutoPEP8:

  1. settings,
  2. issues.

Thanks.

wistful commented 6 years ago

Hi @Kristinita and thanks for such detailed description. The extension uses old autopep8==1.2.2 which aren't aware about E305 error. I'm planning to release new version later this month with most recent version of autopep8.

Kristinita commented 6 years ago

@wistful , in Package Control Messages I see changelog for all versions, not for last version:

Package Control Messages
========================

AutoPEP8
--------

  AutoPEP8 2.0.0 (2018/02/04):
      - ST2 is not supported anymore.
      * autopep8 1.2.2 -> 1.3.3
      + Support pep8 local and global configs.

  AutoPEP8 1.3.6 (2016/04/13):
      * Disable debug output by default.

  AutoPEP8 1.3.5 (2016/04/13):
      * fixed issue with missed argparse package in ST2.
      + added logging

... and so on.

I don't think, that is a good idea. You can see my article, if you want to create changelog and release, use only one command in a command line.

Thanks.