Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Conversation

@aosq
Copy link

@aosq aosq commented Aug 20, 2021

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 🤔).

Comment on lines -112 to -124
{
"regexp": "^([^\\s].*)$",
"file": 1
},
{
"regexp": "^\\((\\d+),(\\d+)\\)-\\((\\d+),(\\d+)\\) (.*)$",
"loop": true,
"line": 1,
"column": 2,
"endLine": 3,
"endColumn": 4,
"message": 5
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only useful when bin/hh-errors is run and there's already a task for that.

@frankeld
Copy link
Contributor

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)"?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants