dhall-lang / dhall-haskell

Maintainable configuration files
https://dhall-lang.org/
BSD 3-Clause "New" or "Revised" License
918 stars 214 forks source link

Align types and values when formatting records #2206

Open ear7h opened 3 years ago

ear7h commented 3 years ago

For example:

let TargetBase =
    { Type =
        { path : Optional Text
        , test : Optional Bool
        , bench : Optional Bool
        , doc : Optional Bool
        , proc-macro : Optional Bool
        , harness : Optional Bool
        , edition : Optional Text
        , crate-type : Optional (List Text)
        }
    , default =
        { path = None Text
        , test = None Bool
        , bench = None Bool
        , doc = None Bool
        , proc-macro = None Bool
        , harness = None Bool
        , edition = None Text
        , crate-type = None (List Text)
        }
    }

becomes

let TargetBase =
    { Type =
        { path       : Optional Text
        , test       : Optional Bool
        , bench      : Optional Bool
        , doc        : Optional Bool
        , proc-macro : Optional Bool
        , harness    : Optional Bool
        , edition    : Optional Text
        , crate-type : Optional (List Text)
        }
    , default =
        { path       = None Text
        , test       = None Bool
        , bench      = None Bool
        , doc        = None Bool
        , proc-macro = None Bool
        , harness    = None Bool
        , edition    = None Text
        , crate-type = None (List Text)
        }
    }
Gabriella439 commented 3 years ago

The main reason against aligning = and : is because it could potentially lead to large diffs when adding/removing fields