Skip to content

Long line containing the await keyword is not being formatted while similar line without await does get proper formatting #771

Open
@ilanKeshet

Description

@ilanKeshet

Python Code

SOME_CONST_IT_DOESNT_REALLY_MATTER = "some_const"


async def some_async_function():
    some_function_which_takes_some_parameters(await some_other_async_function_returning_a_string(), SOME_CONST_IT_DOESNT_REALLY_MATTER, a_kw_arg_value=True)


def some_function_which_takes_some_parameters(*args, **kwargs):
    return args


async def some_other_async_function_returning_a_string() -> str:
    return "some string"


async def some_none_async_function():
    some_function_which_takes_some_parameters(some_other_non_async_function_returning_a_string(), SOME_CONST_IT_DOESNT_REALLY_MATTER, a_kw_arg_value=True)


def some_other_non_async_function_returning_a_string() -> str:
    return "some string"

Command Line and Configuration

-   repo: https://github.com/hhatto/autopep8
    rev: 'v2.3.1'
    hooks:
    -   id: autopep8
        args: ["--in-place", "--max-line-length", "120", "--experimental", "--ignore" , "E301"]

Command Line

$ autopep8 --in-place --max-line-length 120 --experimental --ignore E301

Your Environment

  • Python version: 3.9.2
  • autopep8 version: 2.3.1
  • Platform: macOSX

Expected result

SOME_CONST_IT_DOESNT_REALLY_MATTER = "some_const"


async def some_async_function():
    some_function_which_takes_some_parameters(
        await some_other_async_function_returning_a_string(),
        SOME_CONST_IT_DOESNT_REALLY_MATTER, a_kw_arg_value=True)


def some_function_which_takes_some_parameters(*args, **kwargs):
    return args


async def some_other_async_function_returning_a_string() -> str:
    return "some string"


async def some_none_async_function():
    some_function_which_takes_some_parameters(
        some_other_non_async_function_returning_a_string(),
        SOME_CONST_IT_DOESNT_REALLY_MATTER, a_kw_arg_value=True)


def some_other_non_async_function_returning_a_string() -> str:
    return "some string"

Actual result

SOME_CONST_IT_DOESNT_REALLY_MATTER = "some_const"


async def some_async_function():
    some_function_which_takes_some_parameters(await some_other_async_function_returning_a_string(), SOME_CONST_IT_DOESNT_REALLY_MATTER, a_kw_arg_value=True)


def some_function_which_takes_some_parameters(*args, **kwargs):
    return args


async def some_other_async_function_returning_a_string() -> str:
    return "some string"


async def some_none_async_function():
    some_function_which_takes_some_parameters(
        some_other_non_async_function_returning_a_string(),
        SOME_CONST_IT_DOESNT_REALLY_MATTER, a_kw_arg_value=True)


def some_other_non_async_function_returning_a_string() -> str:
    return "some string"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions