Ark
Ark copied to clipboard
Feature: add a code formatter to the CLI
Blocked by #425
The problem
I'm frustrated when I need to format ArkScript code by hand, because (even I, the creator of the language) I don't remember every formatting rule we wrote somewhere in this organization.
Proposed solution
Integrate a code formatting option in the CLI:
# format file.ark in place
arkscript --format file.ark
# format file but do not write the changes, output them to the terminal
arkscript --format --dry-run file.ark
A pre-requisite would be to keep the comments when parsing. Currently they are discarded as they aren't useful for the codegen.
Otherwise, formatted code would be stripped of any comments.
Edit: marking this blocked by #425
A proper specification for code formatting in ArkScript will have to be drafted first and published to the website