Skip to content

Add config file for formatting defaults #1086

@mheiber

Description

@mheiber

Problem

That the formatter defaults to non-ascii is a barrier to adoption for my team:

  • The pretty lambdas and arrows are perceived as being cute at the expense of practicality, giving the impression that Dhall chooses cuteness over practicality generally.

Proposal

  • dhall-config.dhall is a file for configuring dhall
  • starts with just one option, nested under formatting:
    • { formatting: { ascii: Boolean } } -- defaults to False
  • dhall discovers these config files somehow (TBD)

Thanks for this wonderful language. I could take a stab at a PR if this feature seems useful and doesn't detract from the current minimalism and simplicity too much.

Alternative Considered

We could add a setting for --ascii to the vscode extension.

But then in order for a team to keep the command line option in sync with the vscode extension and to serve users that don't use VSCode, they would need to (for exammple)keep a Makefile, vimrc, .emacs, etc. all in sync.

Prior Art

Every code formatter I could find that has options has a config file:

The only way I've seen to avoid having a config file is to avoid having config, which is what gofmt does. But dhall format is configurable (--ascii).

Notes

  • This proposal is unrelated to what the default value for the formatting option happens to be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions