tfausak / cabal-gild

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

Discover modules from preprocessors #17

Closed tfausak closed 9 months ago

tfausak commented 9 months ago

This fixes #14. See also #16.

These are documented by Cabal here: https://cabal.readthedocs.io/en/3.10/cabal-package.html#modules-and-preprocessors

tfausak commented 9 months ago

For posterity, here's where (I think) Cabal defines which extensions it looks for:

https://github.com/haskell/cabal/blob/2acae632a0d625cd5b54aeb257fc83188344fa03/Cabal/src/Distribution/Simple/SrcDist.hs#L543 https://github.com/haskell/cabal/blob/2acae632a0d625cd5b54aeb257fc83188344fa03/Cabal/src/Distribution/Simple/PreProcess.hs#L909

There are no extensions there that we've missed. There is *.hs-boot and *.lhs-boot, but those always have a corresponding source file so they don't need to be discovered.