Open bartolomej opened 2 months ago
@franklywatson I'm making good progress on the first PR for retaining comments in the AST. Any chance we can get this grant reviewed/approved so that I can put more focus into this and confidently continue my current work?
Category
Description
Cadence formatter is already in the later stages of development. Still, it's missing a few things necessary for the first public release - particularly, retaining comments in the formatted output.
In the scope of this grant, I intend to complete the formatter development and integrate it into the various ecosystem tools so we can release it to the community.
Links
Primary issues to be solved (early milestones):
Follow-up issues (later milestones):
Existing work (WIP):
Problem statement
Manually formatting code is annoying and tedious work, so some developers mostly skip it and leave the code in a less readable state, while others invent their own custom formatting rules/guidelines, which makes the code readable but incompatible with the custom rules of other developers.
That's why most (all) production-quality programming languages provide an official (or a community-based) tool that uses an opinionated set of rules to format the code consistently.
I believe implementing such a tool for Cadence is important for the maturity of the language/ecosystem and will lead to the benefits mentioned above.
Target audience
Evidence for the need
Proposed solution
Retain comments in the AST and include them in the formatted output. Resolve any remaining issues and prepare for the release.
Impact
Cadence source code of any project will have a consistent / easy-to-read style, making it easier for all developers to use and develop using Cadence.
Milestones and funding
• Track comments for all (relevant) AST nodes.
• Fix any remaining issues and tests to make the formatter fully working.
• Add unit test cases for interesting edge cases (e.g. found in production code)
• Resolve any remaining issues that would be a breaking change (in terms of the formatted output) if we introduce them after the tool is released (which won’t be great as it would introduce unnecessary changes in VCS).
• Integrate formatter in VsCode extension via the
formatting API
• Add the necessary documentation
• Help integrate formatter in existing tools/apps (e.g. Contract Browser, Playground,…)
• Advocate prettier tool and help with adoption
Total funding proposed: $25,000
Team