-
Notifications
You must be signed in to change notification settings - Fork 5
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
Exclude option must be interpreted relative to cabal file #71
Comments
Oof yeah, that's a bug. The excluded files should be relative to the Cabal file that they're referenced in. This line will have to change to incorporate the
This wasn't caught by the tests because all the ones for the cabal-gild/source/test-suite/Main.hs Line 66 in 51425c0
I'd be happy to accept a PR to fix this issue. It may take me a while to get around to it. |
If I am not mistaken, HLS doesn't ship with |
Maybe HLS runs the |
Should be the directory of the |
Ah, it seems that I use the current released version of Haskell extension for VSCode and it does not support |
I'm using cabal-gild on monorepo, using
find
command combined withcabal-gild --io
to format everything.For now, cabal-gild shipped with HLS is slightly older and does not support exclusion mechanism, so I use the following command on every save:
This work as expected as long as
--exclude
isn't used in cabal files.OTOH, if one uses relative path in
--exclude
, then cabal-gild resolves the path relative to current working directory, not relative to*.cabal
files.For example, suppose we have
project-core/project-core.cabal
with the following contents:If one invoke cabal-gild inside
project-a
directory, it just emits an emptyother-modules
.On the other hand, if one uses the above
find
-script in the monorepo root, it emits:If one changes the exclude relative to monorepo root, it works as expected:
As cabal resolves relative paths according to
*.cabal
file, I think it would make sense to paths to be resolved relative to cabal files.The text was updated successfully, but these errors were encountered: