Ark icon indicating copy to clipboard operation
Ark copied to clipboard

Feature: add a code formatter to the CLI

Open SuperFola opened this issue 1 year ago • 2 comments

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

SuperFola avatar Feb 26 '23 16:02 SuperFola

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

SuperFola avatar Mar 22 '23 11:03 SuperFola

A proper specification for code formatting in ArkScript will have to be drafted first and published to the website

SuperFola avatar Aug 12 '23 10:08 SuperFola