6 ms·
To do this requires some standard way of encoding an AST which includes comments and dividers. That standard format is commonly known as source code - although
by glenjamin 5y ago
To do this requires some standard way of encoding an AST which includes comments and dividers.
That standard format is commonly known as source code - although it lacks a normal form.
Tools like prettier, gofmt and black can be thought of as a way to produce a normal form of source code.
This is (IMO) a reasonable incremental approach towards exactly what you describe - if a project checks in only source code that's formatted using a standardised format, then you're free to work on it using whatever equivalent representation you like - as long as it's converted back at commit-time.