Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds main to other-modules #96

Closed
BebeSparkelSparkel opened this issue Jul 16, 2024 · 4 comments
Closed

Adds main to other-modules #96

BebeSparkelSparkel opened this issue Jul 16, 2024 · 4 comments
Labels
question Further information is requested

Comments

@BebeSparkelSparkel
Copy link

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
Copy link
Owner

tfausak commented Jul 16, 2024

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

-- cabal-gild: discover tests --exclude=tests/Spec.hs

@tfausak tfausak added the question Further information is requested label Jul 16, 2024
@BebeSparkelSparkel
Copy link
Author

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
Copy link
Owner

tfausak commented Jul 19, 2024

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

@BebeSparkelSparkel
Copy link
Author

1.3.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants