Skip to content

Conversation

@blackheaven
Copy link
Contributor

This aimes to fix #4665.

Note that I directly calling git, as th gitignore format is non-trivial.

I can roll a partial parsing implementation if requested.

@blackheaven blackheaven requested a review from wz1000 as a code owner October 4, 2025 16:42
@blackheaven blackheaven force-pushed the ghcide/use-gitignore branch 2 times, most recently from 013cd7b to 5db38c5 Compare October 4, 2025 16:52
@blackheaven
Copy link
Contributor Author

I don't think the CI failure is related to my PR.

@sgillespie
Copy link
Collaborator

I don't think the CI failure is related to my PR.

Looks like a flaky thing, it fixed itself

@blackheaven
Copy link
Contributor Author

Thanks, let's try again

Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

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

Small comments, otherwise LGTM!

Unfortunately, there are not automated tests for this cli mode, we'd need to add some, but that's some fair amount of work...

recurse y | "." `isPrefixOf` takeFileName y = False -- skip .git etc
recurse y = takeFileName y `notElem` ["dist", "dist-newstyle"] -- cabal directories
in filter (\y -> takeExtension y `elem` [".hs", ".lhs"]) <$> IO.listFilesInside (return . recurse) x
(testGitExitCode, _, _) <- readProcessWithExitCode "git" ["status"] ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if git is not installed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should fallback to the current implementation


expandFiles :: [FilePath] -> IO [FilePath]
expandFiles = concatMapM $ \x -> do
expandFiles paths = do
Copy link
Collaborator

Choose a reason for hiding this comment

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

As the behaviour got more complicated, could you expand the documentation of what this function does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typecheck should ignore .gitignore-ed files

3 participants