spago icon indicating copy to clipboard operation
spago copied to clipboard

Use Dhall’s automatic Unicode vs. ASCII syntax detection

Open toastal opened this issue 3 years ago • 2 comments

I can understand as well as get behind the general community stance that the default Dhall syntax should be ASCII. However, with Dhall 1.38, we can have automatic syntax detection for reformatting. The main reason a user woulld prefer this is so that they can expect the same syntax after using commands that regenerated their spago files (i.e. spago upgrade-set). This can lead to unnecessary git diffs if forgotten as well as it doesn’t match a user’s default expectation when using dhall format.

While it would be easy to change the Just ASCII to Nothing to get the default behavior, I believe it’s important to still make sure that the original format generation is Just ASCII because I believe the formatter defaults to Unicode when missing, but I could be wrong (I tried looking, but it wasn’t clear what the default was so I didn’t do a PR and just swapping to Nothing).

toastal avatar Feb 05 '21 10:02 toastal

I’m still getting annoying diffs that I didn’t expect as a result of running spago upgrade-set. I hope this could be a small and quick fix.

toastal avatar Jun 02 '21 08:06 toastal

I tried to swap the formatter to Nothing to get Dhall's autodetection to work, but e.g. this tests fails because the autoformatter uses Unicode in there.

This is probably a bug to be fixed upstream - I'm generally ok with doing this change but I won't manage to follow up on this so I'd be happy if someone can pick this up

f-f avatar Feb 07 '22 07:02 f-f

The new Spago is not using Dhall anymore

f-f avatar Sep 16 '23 10:09 f-f