microsoft / vscode-autopep8

Formatting support for python using autopep8.
https://marketplace.visualstudio.com/items?itemName=ms-python.autopep8
MIT License
20 stars 13 forks source link

It can work, but there are some doubts. #202

Closed gakkiyomi closed 11 months ago

gakkiyomi commented 11 months ago

env: python 3.11.6 vscode 1.84.2 settings

截屏2023-11-27 20 06 16 截屏2023-11-27 20 06 41

It can be formatted, but not extensively. Why can't this type of code be formatted?

@abstractmethod
def exec(self, api: FishPi, *args: Tuple[str, ...]):
    self.login(str, api, *args[0])
def login(self, api: FishPi, mfa_code: str):
        if len(api.api_key) == 0:
        api.login(GLOBAL_CONFIG.auth_config.username,
                  GLOBAL_CONFIG.auth_config.password, mfa_code)

If there are syntax errors in the code, such as improper indentation, the plugin may not be able to format it?

https://github.com/microsoft/vscode-autopep8/assets/41406557/08fbcb6a-1532-4598-a065-d254811d2d16

karthiknadig commented 11 months ago

@gakkiyomi This extension is a wrapper for autopep8 it doesn't really control its features or behavior. You will need to ask this on https://github.com/hhatto/autopep8