Incorrect comment placement after formatting a multiline list. #18

Closed
opened 2017-04-09 22:21:02 +02:00 by barrucadu · 1 comment
barrucadu commented 2017-04-09 22:21:02 +02:00 (Migrated from github.com)

It looks like if you have a comment on the penultimate line of a multi-line list, the comment gets pushed outside the list:

 -- | Predicates for the various autocheck functions.
 autocheckCases :: Eq a => [(String, Predicate a)]
 autocheckCases =
-  [ ("Never Deadlocks",   representative deadlocksNever)
-  , ("No Exceptions",     representative exceptionsNever)
-  , ("Consistent Result", alwaysSame) -- already representative
-  ]
+  [ ("Never Deadlocks", representative deadlocksNever)
+  , ("No Exceptions", representative exceptionsNever)
+  , ("Consistent Result", alwaysSame)
+  ] -- already representative
It looks like if you have a comment on the penultimate line of a multi-line list, the comment gets pushed outside the list: ```diff -- | Predicates for the various autocheck functions. autocheckCases :: Eq a => [(String, Predicate a)] autocheckCases = - [ ("Never Deadlocks", representative deadlocksNever) - , ("No Exceptions", representative exceptionsNever) - , ("Consistent Result", alwaysSame) -- already representative - ] + [ ("Never Deadlocks", representative deadlocksNever) + , ("No Exceptions", representative exceptionsNever) + , ("Consistent Result", alwaysSame) + ] -- already representative ```
lspitzner commented 2017-04-09 23:47:32 +02:00 (Migrated from github.com)

Right, thanks for reporting. I think I really ought to add some more testing around this; i think there are some variations of this bug around.

(This originates from the goal of being able to transform end-of-line commas in such literals to start-of-line-ones while preserving comment placement - it gets messy.)

Right, thanks for reporting. I think I really ought to add some more testing around this; i think there are some variations of this bug around. (This originates from the goal of being able to transform end-of-line commas in such literals to start-of-line-ones while preserving comment placement - it gets messy.)
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#18
There is no content yet.