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

hlint -g . does not respect .gitignore #1090

Closed
donatello opened this issue Jul 29, 2020 · 3 comments
Closed

hlint -g . does not respect .gitignore #1090

donatello opened this issue Jul 29, 2020 · 3 comments

Comments

@donatello
Copy link

In my repo directory, I have dist-newstyle created by cabal in my gitignore, however hlint -g goes into this directory and returns lint errors for sources checkout by cabal inside this directory.

As a workaround I am using git ls-files | grep '.hs$' | xargs hlint.

@ndmitchell
Copy link
Owner

On my machine it runs git ls-files --cached --others --exclude-standard *.hs *.lhs. What does that command return on your machine? (You probably need to quote the *). I just pushed changes to --verbose so hlint -g -v shows what command it runs, if you want to try HEAD.

@ndmitchell
Copy link
Owner

Ah, I think hlint -g . is saying test all files found by --git AND test all files found by . - together which is everything. As it happens #780 was fixed a few days ago, which likely means that . will start ignoring dist-newstyle anyway.

@donatello
Copy link
Author

Ah I see, I didn't realize that providing a directory/file argument was optional, but it's clear from the --help message now. hlint -g works fine for me. Closing this. Thanks your quick response!

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

No branches or pull requests

2 participants