avh4 / elm-format

elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
BSD 3-Clause "New" or "Revised" License
1.31k stars 145 forks source link

Behavior when encountering errors while formatting multiple files #42

Open Janiczek opened 8 years ago

Janiczek commented 8 years ago

Let's say we format a directory with .elm files:

The second one contains an error that will not allow us to format it. Should we (after displaying an error message) try to format the rest of the files (here third.elm)? (Right now we don't, we exit immediately.)

avh4 commented 8 years ago

@rtfeldman thoughts on this?

We don't know in advance (when we prompt the user) whether files will have errors. I'll propose that we attempt to format each file, saving it if it's successful, and then print out all the errors at the end.

rtfeldman commented 8 years ago

I'd say for now do whatever's easiest to implement. I don't think we can make an informed decision on this until we see what it feels like to use it in the wild, and I'm sure people will open other issues if the chosen behavior becomes a pain in practice!

avh4 commented 8 years ago

This also applies to #67.