Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E131 applies inconsistently with nested calls #953

Open
mattdicarlo opened this issue Jul 16, 2020 · 0 comments
Open

E131 applies inconsistently with nested calls #953

mattdicarlo opened this issue Jul 16, 2020 · 0 comments

Comments

@mattdicarlo
Copy link

mattdicarlo commented Jul 16, 2020

I often use an indentation format like this for long method chains with something like SQLAlchemy, which seems to be acceptable according to my reading of PEP8 and doesn't raise any errors when pycodestyle is run:

rows = db.engine.execute(
    table.select()
         .where(table.c.column1 == 'something')
         .where(table.c.column2.is_(None))
         .order_by(table.c.column3)
         .limit(5)
)

However, if the name of the variable being assigned to is a particular length, E131 - continuation line unaligned for hanging indent is raised:

aaaaaaaa = db.engine.execute(
    table.select()
         .where(table.c.column1 == 'something')  # E131
         .where(table.c.column2.is_(None))       # E131
         .order_by(table.c.column3)              # E131
         .limit(5)                               # E131
)

It seems to be related to having the = operator aligned with the indented lines? Adding just a single character to the left side of the assignment will remove the E131.

aaaaaaaab = db.engine.execute(
    table.select()
         .where(table.c.column1 == 'something')
         .where(table.c.column2.is_(None))
         .order_by(table.c.column3)
         .limit(5)
)

Is this an issue in pycodestyle, or do I just not understand what's going on here?

$ pycodestyle --version
2.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant