ndmitchell / hlint

Haskell source code suggestions
Other
1.46k stars 195 forks source link

hlint -g also checks untracked files #1592

Open turion opened 4 months ago

turion commented 4 months ago

It seems that hlint -g not only checks tracked and checked in files, but also files that are untracked.

In https://github.com/ndmitchell/hlint/issues/1090#issuecomment-668221773 @ndmitchell said that hlint -g runs git ls-files --cached --others --exclude-standard *.hs *.lhs. But this includes the --others flag, which does, according to the git docs:

   -o, --others
      Show other (i.e. untracked) files in the output

And indeed:

❯ hlint --git -v .
# Execute of /home/turion/.nix-profile/bin/git ls-files --cached --others --exclude-standard *.hs *.lhs... took 0.00s
[...]

I believe this is at odds with what hlint tries to achieve, according to the docs:

 -g --git                                 Run on files tracked by git