elm-lang / elm-make

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

The absence of the "--warn" flag is ignored in JSON reports #58

Closed nikita-volkov closed 9 years ago

nikita-volkov commented 9 years ago

E.g., in the following you can see me not specifying "--warn" and yet getting the warning messages in the output:

Nikitas-MacBook-Pro:dca-elm mojojojo$ elm-make src/Main.elm --report=json
[{"tag":"unused import","overview":"Module `DCA.Rendering` is unused.","details":"","region":{"start":{"line":3,"column":1},"end":{"line":3,"column":34}},"type":"warning","file":"src/Main.elm"},{"tag":"unused import","overview":"Module `Svg` is unused.","details":"","region":{"start":{"line":6,"column":1},"end":{"line":6,"column":11}},"type":"warning","file":"src/Main.elm"},{"tag":"unused import","overview":"Module `Svg.Attributes` is unused.","details":"","region":{"start":{"line":7,"column":1},"end":{"line":7,"column":22}},"type":"warning","file":"src/Main.elm"},{"tag":"unused import","overview":"Module `Color` is unused.","details":"","region":{"start":{"line":8,"column":1},"end":{"line":8,"column":30}},"type":"warning","file":"src/Main.elm"},{"tag":"unused import","overview":"Module `DCA.Components.RecommendationsChart` is unused.","details":"","region":{"start":{"line":10,"column":1},"end":{"line":10,"column":67}},"type":"warning","file":"src/Main.elm"}]
Successfully generated elm.js

What's even more unfortunate is that there's no way to work around that.

evancz commented 9 years ago

What is your goal?

When someone asks for JSON output, the assumption is that they are a computer. The idea is to provide all the information possible and let the computer work out how to display it.

What is your case?

nikita-volkov commented 9 years ago

The SublimeText plugin uses that. But I don't want it to show warnings. image

evancz commented 9 years ago

I think this should be an issue on the Sublime Text plugin then. They are showing you info you do not want, so they should provide some way to have settings for this. It is possible this issue will come back to here because I'm thinking of having an elm-warnings.json file where you can set what you care about, but in the meantime, I think the problem is not in elm-make.

texastoland commented 8 years ago

Regardless of resolution it has surprised tooling implementors. A console message about intended usage could fix duplicates of #24. If filtering is easier in Haskell then it might make sense to facilitate tooling implemented in various language/library combinations. I'm passing the torch on Sublime so my opinion is ambivalent too.

deadfoxygrandpa commented 8 years ago

Just to tie up the loose ends here, I've filtered it in my Sublime Text plugin.