-
-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
We tried to plug tree-sitter-tests-formatter in our repository, to format tree-sitter-darklang/test/corpus test files, but decided against it due to the 1.5 GB ( for Rust) it would add to the Dockerfile
We want to write a formatter for our Tree-sitter grammar tests in Darklang
Notes:
- Handle nested directories : not all test files are in
tree-sitter-darklang/test/corpus; some are in nested directories, e.g.tree-sitter-darklang/test/corpus/exhaustive/exprs - maintain a consistent number of # symbols at the beginning of each test header
- trim test names
- keep the test case as is (no trimming no formatting)
- have a triple hyphen (---) separator between the test case and the generated tree
- spacing rules: two newlines after each test block, one after each title, test case, and after the triple hyphen separator
- format the S-expression based on the following example
Example of a formatted test:
==================
boolean - true
==================
true
---
(source_file
(expression
(simple_expression
(bool_literal)
)
)
)
Misc:
- Run the script using the cli?
- Figure out a way to run it in CI
Metadata
Metadata
Assignees
Labels
No labels