1

I've just started looking into Daml and writing some basic templates.

A feature that feels extremely lacking is auto-format. Searched through docs and wasn't able to find anything about it. This feels strange, especially since Haskell has a decent formatter.

Have I missed this information, and there actually is a formatter for Daml?

If not:

  • maybe there is work going on somewhere and there is a ticket to watch for updates?
  • maybe there is a way to use a tool from a similar language (Haskell?) to use for Daml formatting? This one sounds unrealistic, but doesn't hurt to ask.
  • are there some formatting best practices to refer to, if manual formatting is the only option?
Vsevolod
  • 87
  • 6

1 Answers1

4

Unfortunately, there is no autoformatter at the moment and there is no concrete timeline for adding one.

Using Haskell autoformatters doesn’t work particularly well since they fail on any Daml specific syntax (which starts as soon as single vs double columns but while you might find workarounds for that for templates things start falling apart).

I'm not aware of publicly available style guidlines but I think the examples included in the SDK are a good reference.

cocreature
  • 801
  • 5
  • 5
  • Thanks for the quick answer! To tell the truth, this is pretty much what I was expecting to hear, but was hoping that I missed something somewhere. – Vsevolod Aug 19 '22 at 08:01