Error handling #273
No reviewers
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#273
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "error-handling"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
This turned out to be a rather simple change that might make brittany usage a good bit more pleasant if you use any yet-unsupported stuff (TemplateHaskell comes to mind).
Could need a review/a bit more manual testing, as I don't think the test suite would catch a problem here.
@lspitzner could you add a bit more color to this? What about this makes it more pleasant? Maybe some examples?
eh, sure: Take Test.hs
Previous behaviour
> command/stdin
. stdout
! stderr
with this PR
The behaviour is roughly "take each top-level module element, pass it through
brittany
, if you get errors, pass it throughbrittany --exactprint-only
instead".But the granularity is really the top-level module elements; if you have
then it says "somewhere in the
func
is something that is not handled, fall back on exactprint for the wholefunc
, and the whitespaces before "42" would remain. Making this work recursively would be much more work; for that we'd rather handle all syntax that is missing yet :pThanks! Agreed this is much nicer behavior.
Awesome!
Thanks for the feedback.
After testing with multiple inputs, I got sidetracked thinking about proper exit codes for warnings. But this PR certainly does not make this any worse (we just now a few more instances of exit-code-0 plus warnings on stderr). And I think that is the right choice anyway. Merging, finally.