-
Notifications
You must be signed in to change notification settings - Fork 199
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
Allow enabling extensions in a settings file #223
Comments
It's not a parse error for there to be arbitrary stuff in a whamlet block, and HLint is meant to ignore it. Taking the first example at http://www.yesodweb.com/book/basics#basics_hello_world I am able to check that module with no errors. Can you give me an example of a whamlet block that doesn't work? |
src/Handler/NewDesign.hs in Snowdrift has a parse error on the h3 line in:
also src/Handler/User/Create.hs on the line with form
Also src/View/Time.hs:19:9
and other cases |
The error is because you don't have |
Is there a way to add this to an hlint settings file or something? As hlint is integrated with other tools and I also want to minimize the room for manual human command adjustment, it would be much better if there were a way to just set HLint to use this option by default… Incidentally, would you recommend us setting that language extension per file anyway/instead? |
I generally use all extensions explicitly per file, but its really up to you - different people have different preferences, which is why HLint tries to turn on all the extensions it think it can do without breaking stuff. It's just unfortunate in your case the one you need does break stuff sometimes. There's no way to add it to a settings file yet, but I'll leave this bug open to do that. |
Would really like a .hlintrc like pylint has |
@ndmitchell Can you provide some hints as to what a
Not sure. EDIT: Oh, I just saw #160. So, perhaps it should all be centered around the |
I would imagine you could put extensions in the
Furthermore it seems to make sense to allow arbitrary command line flags in the
|
You can now create a |
🎉 |
Btw, I've now got the release almost ready to go, so if anyone wants to try it out I'd welcome any feedback before the actual release. |
does the .hlint.yaml file go universally in ~/ or in a project's directory or either/both…? |
@wolftune we search the current directory upwards, so a projects directory. I considered in ~/, but in the end decided to replicate the stylish-haskell logic, since I'm trying to be more consistent with other tools. |
thanks |
@ndmitchell should it also work for I tried adding
But it didn't seem to work. |
@AlexeyRaga That works for me to enable extensions, however, you don't need to enable MultiParamTypeClasses as that's on by default, so it's no great surprise enabling it doesn't have any impact. What error are you seeing or change are you trying to get? |
@ndmitchell Oh, sorry, I think the error is actually from |
hm, it doesn't seem to work when I enable the module Model.File where
import qualified Data.Bson as Bson
import Data.Int (Int64)
import Data.Time.Clock (UTCTime)
import GHC.Generics (Generic)
-- | Represents a file stored in Mongo GridFS.
data File = File
{ _id ∷ Bson.ObjectId
, length ∷ Int64
, uploadDate ∷ UTCTime
, fileName ∷ String
} deriving (Eq, Show, Generic) ▲ haskell/2018/spreadsheet-api cat .hlint.yaml
- arguments: [-XUnicodeSyntax]
▲ haskell/2018/spreadsheet-api hlint src/Model/File.hs --refactor
refactor: (RealSrcSpan SrcSpanOneLine "src/Model/File.hs" 10 16 17,"parse error on input \8216\8759\8217")
CallStack (from HasCallStack):
error, called at src/Main.hs:189:22 in main:Main
△ haskell/2018/spreadsheet-api hlint --version
HLint v2.0.11, (C) Neil Mitchell 2006-2017 |
@vyorkin Does it work if you don't pass |
I opened #465 to track the refactor issue separately. I don't think it has anything to do with extensions in a settings file. |
Without
it correctly reports it:
with
|
Yep, since it doesn't touch refactor unless there are hints to be dealt with. Leaving this to #465 |
@ndmitchell This answer was exactly what I was looking for, but there is typo: it should be QuasiQuotes, not QuasiQuote (s is missing!). It took me some time to figure out that was the problem! |
Thanks for mentioning that @Martinsos - I've raised #1093 to emit a warning - way too easy to make a typo here |
Great, that is even better :)! |
I really don't like continually seeing parse errors for things like
[whamlet|
blocks. I get that hlint can't deal with whamlet. It should ignore it and similar cases instead of reporting the parse error.The text was updated successfully, but these errors were encountered: