BranchTaken / Hemlock

Programming language
Other
31 stars 3 forks source link

Implement `hmph` code formatter #226

Open jasone opened 2 years ago

jasone commented 2 years ago

Hemlock's syntax makes hmph's job simple relative to most languages, but there are still a few things a Hemlock code formatter should do to files as a whole:

Additionally, hmph should be capable of operating on ranges of lines rather than whole files. Differences to whole-file mode include:

Naturally, hmph should do minimal (and only recoverable) harm to malformed code. This means at least:

jasone commented 2 years ago

Bar string syntax is going away, so hmph's job is further simplified. It would be possible to treat strings which are contextually known to be docstrings as Markdown and rewrap, but it's probably best to just leave strings alone.