tfausak / cabal-gild

:crown: Format Haskell package descriptions.
https://hackage.haskell.org/package/cabal-gild
MIT License
49 stars 5 forks source link

Strip blank spaces from sections using curly brackets #22

Closed tfausak closed 9 months ago

tfausak commented 9 months ago

It's possible to define a section using braces (curly brackets) rather than layout (indentation). For example:

library { default-language: Haskell2010 }

These are discouraged, but allowable as input. Explicit support for this is nice because other tools could emit package descriptions using braces and then use Gild to turn it into the normal layout format.

This pull request started by adding tests for sections like this, then noticing that extra spaces snuck in. So I figured I might as well strip the extra blank spaces since generally there should be no trailing space in the output.