Purty 5.0.0 released

:tada: :tada:

Time for another weekly release of purty . This is a big release with some fairly large internal milestones. You can grab the npm package or go directly for the binaries.

Notes from the changelog


This is a big one! There are three important differences from previous verions of purty:

  1. Configuration files are no longer supported.
    The configuration never panned out how it was supposed to.
    It was never meant to be for altering formatting, but for configuring the CLI.
    It was also meant to be an example of using Dhall.

  2. Binaries are statically linked.
    The binaries we were creating up until now have been dynamically linked.
    We were privvy to the same issues that the PureScript compiler runs into from time to time (runtime libraries not existing).
    We decide to link binaries statically, so we can mitigate runtime issues.
    We also can do more interesting things (like creating minimal Docker images) with statically linked binaries.

  3. Directories are supported.
    If you’ve used purty on any non-trivial codebase, you’ve probably run into an issue with trying to format multiple files.
    Up until now, you’ve had to script your own way to run all of these files.
    Depending on how you run purty, this could be a slow and tedious process.
    Now we support formatting all .purs recursively in a directory.
    This should make it easier to use purty in larger projects.

There were some other minor changes for dependencies in this release as well.





It’s interesting that you decided to drop the configuration. All config options are via flags now? To make it easier to invoke the command with a set of default flags for a project, the user is expected to create a shell script to preapply them? I’m fine with that, but I think it’s an interesting change.

The configuration was:

{ output : < STDOUT | Write >
, verbose : < NotVerbose | Verbose >

Now that configuration is gone, you have exactly these four ways to call purty (that do something useful):

$ purty $FILE
$ purty $FILE --write
$ purty $FILE --verbose
$ purty $FILE --verbose --write

You can definitely put that in a script if you want to, or if you need to interface with a larger project. But, I don’t know that it’s necessary to write a script to call purty and definitely isn’t the official recommendation.

1 Like