dhall-haskell icon indicating copy to clipboard operation
dhall-haskell copied to clipboard

Align types and values when formatting records

Open ear7h opened this issue 4 years ago • 1 comments
trafficstars

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)
		}
	}

ear7h avatar Jun 03 '21 01:06 ear7h

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

Gabriella439 avatar Jun 03 '21 14:06 Gabriella439