tfausak / cabal-gild

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

Adds main to other-modules #96

Closed BebeSparkelSparkel closed 2 months ago

BebeSparkelSparkel commented 2 months ago

I am using hspc-discovery and the file Spec.hs has the main function and is not a module. cabal-gild adds Spec to other-modules causing the error

tests/Spec.hs:3:8: error:
    File name does not match module name:
    Saw: _Main_
    Expected: _Spec_

Non-modules should not be added to other modules especially if the file is listed with main-is: Spec.hs

tfausak commented 2 months ago

Can you exclude the Spec module from Gild's discovery?

-- cabal-gild: discover tests --exclude=tests/Spec.hs
BebeSparkelSparkel commented 2 months ago

Thanks for the tip of using the exact path.

I had tried exclude with glob patterns as specified in the README but the patterns do not seem to work.

-- cabal-gild: discover tests --exclude=**/Spec.hs
-- cabal-gild: discover tests --exclude=*/Spec.hs
tfausak commented 2 months ago

Which version are you using? Support for excluding patterns was added in Gild 1.3.2.0.

BebeSparkelSparkel commented 2 months ago

1.3.1.1