avh4 / elm-format

elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
BSD 3-Clause "New" or "Revised" License
1.31k stars 147 forks source link

Cannot find the standard the formatter is based on #286

Closed ghost closed 5 years ago

ghost commented 7 years ago

I would like to know where this standard is coming from, since there's no specification within elm-format and the style guide from elm-lang is rather liberal:

Namely, elm-lang's core libraries use 2 spaces as indentation, and though nothing is stated about this in the style guide, I take it 2 spaces is the way to go. elm-format decides to use 4 spaces (fair enough) but again there's no convention specs.

This obviously applies to a number of other cases.

adriantoine commented 7 years ago

Yeah I am a bit confused, I'm learning Elm and https://github.com/evancz/elm-architecture-tutorial uses 2-space indentation and every time I save a file there, elm-format reformats it, which means that the official tutorial doesn't use the right convention? Though, the official docs recommends using elm-format.

avh4 commented 7 years ago

Evan has been waiting until elm-format hits v1.0 before formatting all the code examples in the official docs. Sorry for the delay!

avh4 commented 7 years ago

Also, the official style guide is here: http://elm-lang.org/docs/style-guide It's not very comprehensive, though, so a lot of edge cases have been defined during the development of elm-format (with input from the community on the mailing lists).

adriantoine commented 7 years ago

@avh4 cool, thanks for the update!