elm-lang / elm-make

A build tool for Elm projects
BSD 3-Clause "New" or "Revised" License
175 stars 45 forks source link

Error in package parsing/installation ignores --report=json flag #41

Closed bbugh closed 9 years ago

bbugh commented 9 years ago

Hey, I made the Elm Linter package for Sublime Text 3, https://github.com/bbugh/SublimeLinter-contrib-elm-make :cake:

Problem: One of the issues I ran into is that packaging errors aren't reported by the json reporter. Instead, they are reported with the usual plaintext message. There's two specifically that I found and had to manually handle, but there is likely more. This means that I unfortunately had to handle each one individually as an edge case, so it's likely I've missed more. It's also not possible to highlight the line where the problem is, as these reports don't list a a line or column range.

Reproduction: The command used is elm-make --warn --report=json <filename>. Either of these lines will reproduce an error that is not json format:

The "Could not find module" error :horse:

import Horse

and the "Some packages are needed" error

-- without Http package installed
import Http

Desire: It would be much easier to use the json reporter if it was consistently reporting errors of all types!

I'd fork and submit a pull request to fix it, but I don't understand Haskell at all. I feel a bit silly that I can't even figure out where the error message text is coming from...

texastoland commented 9 years ago

All the JSON issues could be collected into a meta issue c.f. #26, #38. What's most interesting about your error is the output isn't buffered but arbitrarily chunked. Also discovered in Sublime :+1:

evancz commented 9 years ago

Closing in favor of #46 which will cover this and others.