-
Notifications
You must be signed in to change notification settings - Fork 195
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
Cross option seems to cause duplicate warnings #1018
Comments
Let's roll with 3.x hlint! Rework the ignore list, drop `--cross` as that seems to break hlint (ndmitchell/hlint#1018), etc.
The only hint that gets enabled by (I'll look into whether its easy to fix this evening - it may be we're doing something stupid, and O(n^2) would definitely be a problem) |
To be fair, I don't know what If it's just duplication… hmm, yes, I have used duplication checks, and found them somewhat useful. But I'd definitely prefer not having that if it makes hlint N times slower, or I could easily use something else if available. |
Running HLint on HLint
There was totally an O(n^2) bug in there! We had a list comp and did for each module, and then again a few lines later, did the same again. At one point one of those was for each haskell-src-exts module and one was for each GHC module - which is how the bug got introduced. That function is only called with singletons apart from the rare case where you pass Fantastic spot! |
Fixed in 3.1.4 and I wrote a post since its a fun bug: https://neilmitchell.blogspot.com/2020/05/hlint-cross-was-accidentally-quadratic.html |
I've been running with
--cross
for a long while, but since a recent update (testing with 3.1.3 now), it seems to cause two thingsOn a given codebase, non-cross takes ~3.5s, while cross takes ~1m10s, so it kind of looks like it does a cartesian product of all the module pairs?
Running on a minimal example, I have two files, each one function:
x.hs
):y.hs
):Standard run:
This is as expected. Run with
--cross
:Copying
y.hs
toz.hs
results in 3 times the same warning, etc.Note the same files when checked with hlint 2.1.11 from Debian unstable seems to work fine:
Help?
The text was updated successfully, but these errors were encountered: