SwiftFormat Adding Extra Indentation to Empty Array

Created on 29 May 2020  路  4Comments  路  Source: nicklockwood/SwiftFormat

Just updated our SwiftFormat version from 0.44.5 to 0.44.12 and we encountered the following error:

Before:

JSON([
  "data": [
    "rows": [
    ],
  ],
])

After:

JSON([
  "data": [
    "rows": [
      ],
  ],
])

The only change to the config was to add: --specifierorder convenience,override.

As far as I can tell (as the real version of this code is much larger) is that is only happens with these empty arrays.

bug fixed in develop

All 4 comments

@PompeiaPaetenari can you check if it also happens with 0.44.11?

@PompeiaPaetenari can you check if it also happens with 0.44.11?

Yes, it does it there, too.

@PompeiaPaetenari thanks for checking. I'll get this fixed asap.

@PompeiaPaetenari fixed in 0.44.13.

Was this page helpful?
0 / 5 - 0 ratings