ndmitchell / hlint

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

Options Not Working In v1.9.41? #304

Open eatobin opened 7 years ago

eatobin commented 7 years ago

I recently upgraded to ghc 8.0.2 and stack lts-8.0 from ghc 8.0.1 and stack lts-7.10. Accordingly, I ran stack install hlint to use an hlint built with the new version of ghc.

With the old setup this would work just fine:

eric@linux-epth:total-beginner-haskell$ hlint src/Borrower.hs --hint=Generalise
src/Borrower.hs:44:3: Suggestion: Use mappend
Found:
  getName br ++
    " (" `mappend` show (getMaxBooks br) `mappend` " books)"
Why not:
  getName br `Data.Monoid.mappend`
    (" (" `mappend` show (getMaxBooks br) `mappend` " books)")

1 hint

After the upgrade to v1.9.41 (from v1.9.35 I think) this no longer seems to be working:

eric@linux-epth:total-beginner-haskell$ hlint src/Borrower.hs --hint=Generalise
No hints

How can I correct this?

Thank you.

EDIT: Sorry, got this fixed: hlint src/Borrower.hs --hint=Generalise.hs works correctly...

ndmitchell commented 7 years ago

Did --hint=Generalise ever work? Is this a regression but you found a workaround? Or not a regression at all? I'm not sure I have great tests for this aspect, so adding them might be a good idea anyway.

eatobin commented 7 years ago

No, --hint=Generalise did not work - although it did previously under v1.9.35. Just went with --hint=Generalise.hs which was fine. Took a while to figure what had changed to cause failure and documentation still supports the former format so I do suggest a test(s) for the regression. Thank you for the review.

ndmitchell commented 7 years ago

Thanks for the info, given it's a regression, I'll aim to fix it so it still works as advertised.

ndmitchell commented 7 years ago

This seems to work for me, and I've added a test. Can you give some more information - e.g. what is in Borrower.hs? Which OS/GHC version etc?

eatobin commented 7 years ago

Sure. How's this:

eric@linux-epth:~$ uname -a
Linux linux-epth 4.9.9-1-default #1 SMP PREEMPT Thu Feb 9 10:55:53 UTC 2017 (6c5120c) x86_64 x86_64 x86_64 GNU/Linux
eric@linux-epth:~$ java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
eric@linux-epth:~$ lein --version
Leiningen 2.7.1 on Java 1.8.0_112 Java HotSpot(TM) 64-Bit Server VM
eric@linux-epth:~$ git --version
git version 2.11.0
eric@linux-epth:~$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /home/eric/bin/apache-maven-3.3.9
Java version: 1.8.0_112, vendor: Oracle Corporation
Java home: /home/eric/bin/java/jdk1.8.0_112/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.9.9-1-default", arch: "amd64", family: "unix"
eric@linux-epth:~$ psql --version
psql (PostgreSQL) 9.4.10
eric@linux-epth:~$ stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0
eric@linux-epth:~$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2
eric@linux-epth:~$ ghc-mod --version
ghc-mod version 5.6.0.0 compiled by GHC 8.0.2
eric@linux-epth:~$ ghcid --version
Auto reloading GHCi daemon v0.6.6
eric@linux-epth:~$ stylish-haskell --version
stylish-haskell 0.7.1.0
eric@linux-epth:~$ cabal --version
cabal-install version 1.24.0.2
compiled using version 1.24.2.0 of the Cabal library 
eric@linux-epth:~$ hdevtools --version
hdevtools: version 0.1.5.0 (ghc-8.0.2-x86_64-linux, cabal-1.24.2.0)
eric@linux-epth:~$ hlint --version
HLint v1.9.41, (C) Neil Mitchell 2006-2016
eric@linux-epth:~$ idris --version
0.12.3

I've attached Borrower.hs.txt too... Borrower.hs.txt