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

Format on save adding lines to file #40

Closed luizpericolo closed 8 years ago

luizpericolo commented 8 years ago

When I save a file and the code is formatted, the plugin adds some characters to the end of the file, usually some part of the last line of the file.

The above code is PEP8 complient:

def increment(val, offset):
    return val += offset
if __name__ == '__main__':
    a = increment(10, 1)

If, for instance, I forget to add spaces between the compound additive operator and any of the variables and save the file, autopep8 swoops to the rescue, but produces the following code:

def increment(val, offset):
    return val += offset

if __name__ == '__main__':
    a = increment(10, 1)
)

Notice the closing parentheses added to the last line of the file. It is not always the same character either. Sometimes "(10, 1)" is added or any other part of the content of the last line of the file when it is saved.

wistful commented 8 years ago

Fixed in 1.3.3-rc1

luizpericolo commented 8 years ago

How do I install it to sublime?

Atenciosamente,


Luiz Felipe da Costa Pericolo Barbosa UFRJ - Ciência da Computação / Computer Science "Are you suggesting coconuts migrate?" "Stay hungry. Stay foolish."

On 25 October 2015 at 16:12, Mikhail notifications@github.com wrote:

Fixed in 1.3.3-rc1

— Reply to this email directly or view it on GitHub https://github.com/wistful/SublimeAutoPEP8/issues/40#issuecomment-150949578 .

wistful commented 8 years ago

@luizpericolo, you can install dev versions for specific packages using install_prereleases option of Package Control settings:

"install_prereleases":
    [
        "AutoPEP8"
    ],

After that you can upgrade AutoPEP8 package to the last development version.

luizpericolo commented 8 years ago

Cheers!

wistful commented 8 years ago

Fix is included into stable version 1.3.3.