Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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
Member

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants