Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between `dhall format` and `dhall lint`

Tags:

dhall

Playing with dhall for the first time I saw that it supports these two options:

  ./dhall --help
  ...
  lint                     Improve Dhall code
  format                   Formatter for the Dhall language

What's the difference between the two? From running them on my sample project it appears they to the same thing. I'd have expected the linter to go further than formatting in some ways (e.g. recommending "idiomatic" dhall) but couldn't find any info on it.

like image 768
Johannes Rudolph Avatar asked Jan 07 '19 15:01

Johannes Rudolph


1 Answers

The improvements dhall lint does (at the time of this writing) are listed here and currently consist of:

  • removing unused let bindings
  • consolidating nested let bindings to use a multiple-let binding
  • switching legacy List-like Optional literals to use Some / None instead
  • removing the constructors keyword

Generally, you should expect the dhall lint improvements to fall into one of two categories:

  • Non-controversial improvements to the code

    ... such as the first improvement to remove unused let bindings

  • Automatic code migrations to help users stay current with newer language features

    ... such as the last three improvements

like image 125
Gabriella Gonzalez Avatar answered Sep 28 '22 17:09

Gabriella Gonzalez