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

Allow excluding patterns #84

Merged
merged 5 commits into from
Jun 18, 2024
Merged

Allow excluding patterns #84

merged 5 commits into from
Jun 18, 2024

Conversation

tfausak
Copy link
Owner

@tfausak tfausak commented Jun 17, 2024

Fixes #66.

This is wildly inefficient, which is why it's still a draft. I think the best way forward is to change MonadWalk to be a wrapper around getDirectoryFilesIgnore. That way I should be able to efficiently support both excluding and including (#67).

cabal-gild.cabal Outdated Show resolved Hide resolved
@tfausak tfausak marked this pull request as ready for review June 18, 2024 01:39
expectDiscover
[["M.hs"]]
"library\n -- cabal-gild: discover .\n exposed-modules:"
"library\n -- cabal-gild: discover .\n exposed-modules: M\n"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new test since I changed all the existing discover . to just discover.

(Either E (), S, W)
runGild arguments inputs files =
runTest
(Gild.mainWith arguments)
( Map.fromList inputs,
Map.mapWithKey (\d fs -> FilePath.combine d <$> fs) $ Map.fromList files
Map.singleton "." (fmap FilePath.joinPath files)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changed since now walk is only ever called with "." as the first argument.

@tfausak
Copy link
Owner Author

tfausak commented Jun 18, 2024

This is arguably a breaking change since you can no longer discover modules outside the current directory, but that never would've worked with Cabal anyway so I don't think it matters.

Note that the only special character is *, so old exclusions will continue to work exactly the same as before (as long as they don't contain *, which would be very unusual).

@tfausak tfausak merged commit 6c943d9 into main Jun 18, 2024
10 checks passed
@tfausak tfausak deleted the gh-66-exclude-glob branch June 18, 2024 01:53
@tfausak tfausak added the enhancement New feature or request label Jun 18, 2024
@tfausak tfausak mentioned this pull request Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow excluding multiple files using globs
1 participant