hpack
hpack copied to clipboard
Multi-line `flags` `description` produces invalid Cabal file
flags:
meh:
description: |
This is some text
on multiple lines
that should be indented.
manual: true
default: true
produces
flag meh
description: This is some text
on multiple lines
that should be indented.
manual: True
default: True
which causes Cabal to complain
Warning: foo.cabal:53:1: Ignoring section: "that"
Warning: foo.cabal:52:1: Ignoring section: "on"
indenting just one space more than the field name allows it to work
flag meh
description: This is some text
on multiple lines
that should be indented.
manual: True
default: True
This is definitely a bug. There may also be issues with empty lines and how to handle those across different Cabal versions.
description properly supports both multiple lines and empty lines. It may be possible to reuse that code.
I raised a pull request intended to fix this.