Indentation decrease for comments within if/then/else blocks #167

Closed
opened 2018-08-01 19:55:24 +02:00 by 5outh · 0 comments
5outh commented 2018-08-01 19:55:24 +02:00 (Migrated from github.com)

Consider the following bit of code:

foo = if True
  then
                  -- foo
    "a                                                                           "
  else
    "b                                                                           "

When running brittany over this file, the comment block gets repeatedly unindented, two spaces at a time:

weird-brittany

I would expect the comment to get moved to a particular column after the first brittany reformatting, then stay fixed at that location for subsequent runs. Preferably the comment would start on column 5, aligned with the "a ...".

Brittany info:

$ brittany --version
brittany version 0.11.0.0
Copyright (C) 2016-2018 Lennart Spitzner
There is NO WARRANTY, to the extent permitted by law.
Consider the following bit of code: ```hs foo = if True then -- foo "a " else "b " ``` When running `brittany` over this file, the comment block gets repeatedly unindented, two spaces at a time: ![weird-brittany](https://user-images.githubusercontent.com/959901/43539173-1cdd4f0e-9592-11e8-8ffc-ad0e79f07022.gif) I would expect the comment to get moved to a particular column after the first `brittany` reformatting, then stay fixed at that location for subsequent runs. Preferably the comment would start on column 5, aligned with the `"a ..."`. Brittany info: ```sh $ brittany --version brittany version 0.11.0.0 Copyright (C) 2016-2018 Lennart Spitzner There is NO WARRANTY, to the extent permitted by law. ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#167
There is no content yet.