tree-sitter-hack icon indicating copy to clipboard operation
tree-sitter-hack copied to clipboard

Remove bin/hh-errors from bin/test-corpus

Open aosq opened this issue 3 years ago • 1 comments

This PR removes the call to bin/hh-errors inside bin/test-corpus. bin/test-corpus is useful on its own and a user can always run bin/hh-errors if they want to find those errors.

This PR also renames bin/hh-json to bin/hh-parse. This script runs hh_parse it just returns the output as JSON. Also using "parse" creates a nice symmetry with the VSCode task ts-parse (which maybe we should add script for in bin/ts-parse 🤔).

aosq avatar Aug 20 '21 07:08 aosq

With this change, I think the only difference between npm run test and npm run test-corpus is that test-corpus generates the parser beforehand. This doesn't feel very clear from the script names. For example, in the README, we write

## Testing
```
$ npx tree-sitter generate
$ bin/test-corpus
```

when technically just $ bin/test-corpus would do. What is the use case for this difference? Could we make a new script option that runs hh-errors on all the case files a la bin/hh-errors "$($fd '\.(hack|php)$' test/cases)"?

frankeld avatar Aug 23 '21 15:08 frankeld