peter-evans / autopep8

A GitHub action for autopep8, a tool that automatically formats Python code to conform to the PEP 8 style guide.
MIT License
84 stars 15 forks source link

Decorators spearated when brackets are not closed #58

Closed MarioJSchwaiger closed 3 years ago

MarioJSchwaiger commented 3 years ago

I'm using autopep8 in emacs to write my python-code and lately I found some wrong behaviour of one of the auto-format-features:

Given this wrong code (note the not correctly closed brackets):

def doStuff(self, s_database):
    return ("ASDF"

@staticmethod
def doOtherStuff(self, param):
    doSomething()

The auto-correct will trigger this wrong behaviour, creating another syntax-error:

def doStuff(self, s_database):
    return ("ASDF"

@ staticmethod
def doOtherStuff(self, param):
    doSomething()

Here's my Elpy-Config:

Emacs.............: 26.3
Elpy..............: 1.35.0
Virtualenv........: None
Interactive Python: ipython3 7.13.0 (/usr/bin/ipython3)
RPC virtualenv....: rpc-venv (/home/qohelet/.emacs.d/elpy/rpc-venv)
 Python...........: python3 3.8.5 (/home/qohelet/.emacs.d/elpy/rpc-venv/bin/python3)
 Jedi.............: 0.18.0
 Rope.............: 0.18.0
 Autopep8.........: 1.5.5 (1.5.6 available)
 Yapf.............: 0.30.0 (0.31.0 available)
 Black............: 20.8b1
Syntax checker....: flake8 (/home/qohelet/.local/bin/flake8)
peter-evans commented 3 years ago

Hi @MarioJSchwaiger

This project is just a wrapper around autopep8 for use with GitHub Actions. For this kind of issue, please direct it to the official repository for autopep8 here: https://github.com/hhatto/autopep8