hhatto/autopep8

'Staircase' formatting

Opened this issue · 0 comments


Python Code

def some_func():
    foo = (
        [
            [
                1, 2, 3], [
                1, 2, 3], [
                    1, 2, 3], [
                        1, 2, 3], [
                            1, 2, 3], [
                                1, 2, 3], [
                                    1, 2, 3], [
                                        1, 2, 3], [
                                            1, 2, 3], [
                                                1, 2, 3], [
                                                    1, 2, 3], [
                                                        1, 2, 3], [
                                                            1, 2, 3], [
                                                                1, 2, 3], [
                                                                    1, 2, 3], [
                                                                        1, 2, 3], [
                                                                            1, 2, 3], [
                                                                                1, 2, 3], [
                                                                                    1, 2, 3], [
                                                                                        1, 2, 3], [
                                                                                            1, 2, 3], [
                                                                                                1, 2, 3], [
                                                                                                    1, 2, 3], [
                                                                                                        1, 2, 3], [
                                                                                                            1, 2, 3], [
                                                                                                                1, 2, 3], [
                                                                                                                    1, 2, 3], [
                                                                                                                        1, 2, 3], [
                                                                                                                            1, 2, 3], [
                                                                                                                                1, 2, 3], [
                                                                                                                                    1, 2, 3], [
                                                                                                                                        1, 2, 3], [
                                                                                                                                            1, 2, 3], [
                                                                                                                                                1, 2, 3], [
                                                                                                                                                    1, 2, 3], [
                                                                                                                                                        1, 2, 3], [
                                                                                                                                                            1, 2, 3], [
                                                                                                                                                                1, 2, 3], [
                                                                                                                                                                    1, 2, 3], [
                                                                                                                                                                        1, 2, 3], [
                                                                                                                                                                            1, 2, 3], [
                                                                                                                                                                                1, 2, 3], [
                                                                                                                                                                                    1, 2, 3], [
                                                                                                                                                                                        1, 2, 3], [
                                                                                                                                                                                            1, 2, 3], [
                                                                                                                                                                                                1, 2, 3], [
                                                                                                                                                                                                    1, 2, 3], [
                                                                                                                                                                                                        1, 2, 3]])

When I run autopep8, it seems to think that this is correct formatting. I expect the indent of every row to be the same, and for each row of the data to begin with an open square bracket.

Command Line and Configuration

No file configuration

Command Line

$ autopep8 --diff --max-line-length=120 path/to/file.py

Your Environment

  • Python version: 3.12.3
  • autopep8 version: autopep8 2.1.1 (pycodestyle: 2.11.1)
  • Platform: windows 11