ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

Warn on HSE mis-parse #375

Open michaelbjames opened 3 years ago

michaelbjames commented 3 years ago

An attempt to fix https://github.com/ndmitchell/hoogle/issues/362, albeit a bit rough.

Before this fix, if you ran hoogle generate --local=. on the hoogle repo you would get an error hseToItem failed, from trying and failing to parse the CHANGES.txt file. After this change, you will get that same message in the .warn file, but Hoogle will happily generate the rest of the database.

I will readily admit this is an inelegant fix. If a stray .txt file in the directory being scanned contains valid haskell on any line it will be slurped up by HSE. I think this is an acceptable tradeoff, considering the alternative is that every .txt file must contain valid HSE-parsable haskell on every line, otherwise Hoogle will not generate a database.