formatter.Format is not applicable to ast.Node
Open
- Dominant language
- Go
- Stars
- 1.8k
- Forks
- 263
- PR merge metrics
- No merged PRs in 30d
Description
jsonnetfmt.Format makes a lot of good logic in the internal method without exposing as methods.
This results in disability to use custom-written formatters and get the best from jsonnetfmt, requiring to pipe results to jsonnetfmt after any changes, which is more frustrating when we already have ast.Node and do not need to unparse it again.
Let's expose everything Format does as a new method `FormatNode(root ast.Node, finalFodder ast.Fodder, options formatter.Options)` and keep initial Format() as a wrapper that does AST and applies FormatNode to it?
Contributor guide
Assessment
This issue has not been assessed yet.