hirosystems / clarinet

Write, test and deploy high-quality smart contracts to the Stacks blockchain and Bitcoin.
https://hiro.so/clarinet
GNU General Public License v3.0
297 stars 130 forks source link

Add an opinionated formatter #606

Open obycode opened 2 years ago

obycode commented 2 years ago

It is always useful to have a formatter to fix whitespace and other minor formatting changes in your code. Our VSCode extension should provide a formatter for Clarity files.

obycode commented 2 years ago

I believe the main missing component needed to implement this would be maintaining the comments in the AST. There is currently no data structure to hold comments, so they are treated the same as whitespace in the code. If we add a new PreSymbolicExpressionType for comments, then it should be relatively easy to implement a formatter.

lgalabru commented 1 year ago

Related https://github.com/hirosystems/clarinet/pull/664

smcclellan commented 1 year ago

@hugocaillard to add more detail here.

smcclellan commented 1 month ago

Update: This will be started either later this quarter (Q3) or start of next.