atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

Add additional file for the lint/hlint check #123

Closed marosseleng closed 8 years ago

marosseleng commented 8 years ago

Hi, I use haskell-IDE when working on my school project in Haskell. We were given the file (say Hlint.hs), that contains additional hints for the hlint. The instructions were to place it in the ~/.ghc folder. This works when I run hlint from the Terminal. It's because, we were also given another file (ghci.conf) that contains the definition of the ghci command :hlint so it's pretty easy to execute hlint directly from the ghci. My question is whether it is possible to integrate the additional hint file (Hlint.hs) within the lint/hlint part of the IDE so that it could show me additional hints, that are setup in that file. Thanks for the response.

lierdakil commented 8 years ago

I think you can do something like this with ghc-mod lint --hlintOpt --hint --hlintOpt /path/to/HLint.hs <file to lint>. At the moment, there is no option to pass user arguments to ghc-mod though. I might be able to make a quick patch for that though.

marosseleng commented 8 years ago

That would be awesome, I think not just for me, but for other user that depend on custom lint's tips! Thanx.

lierdakil commented 8 years ago

Okay, so there is hlintOptions setting in v1.10.0. You can specify comma-separated list of options that will be passed to hlint. DO NOT add --hlintOpt, it's done automatically.

F.ex., --hint=/path/to/hint/file,--ignore=hint-to-ignore.

Refer to hlint --help for available options.

marosseleng commented 8 years ago

Well done! Thank you again, mate. I think you can close this issue now.