Skip to content

Commit

Permalink
chore: remove js parsing script
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdw authored and amaanq committed Jan 22, 2024
1 parent 9704771 commit e3002a1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 108 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -25,3 +25,13 @@ jobs:
python-version: '3.12'
- run: npm install
- run: npm test
- run: npm run test-examples
test_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm install
- run: npm test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
"build-php": "cd php && tree-sitter generate --no-bindings",
"build-php_only": "cd php_only && tree-sitter generate --no-bindings",
"lint": "eslint common/define-grammar.js",
"test": "npm run test-php && npm run test-php_only && npm run test-load",
"test-examples": "script/parse-examples",
"test-load": "node -e \"console.log(require('./php').name, require('./php_only').name)\"",
"test": "npm run test-php && npm run test-php_only && npm run test-load && node script/parse-examples.js",
"test-php": "cd php && tree-sitter test",
"test-php_only": "cd php_only && tree-sitter test"
},
Expand Down
6 changes: 4 additions & 2 deletions script/parse-examples
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ function clone_repo {
}

clone_repo laravel laravel 9d0862b3340c8243ee072afc181e315ffa35e110
clone_repo laravel framework 45d439e98a6b14afde8911f7d22a265948adbf72
clone_repo phacility phabricator d0b01a41f2498fb2a6487c2d6704dc7acfd4675f
clone_repo sebastianbergmann phpunit 5e523bdc7dd4d90fed9fb29d1df05347b3e7eaba
clone_repo WordPress WordPress 45286c5bb3f6fe5005567903ec858d87077eae2c
clone_repo wikimedia mediawiki b6b88cbf98fb0c7891324709a85eabc290ed28b4

known_failures=$(cat script/known-failures.txt)

Expand All @@ -39,9 +41,9 @@ tree-sitter parse -q \

example_count=$(find examples -name '*.php' | wc -l)
failure_count=$(wc -w <<<"$known_failures")
success_count=$(("$example_count" - "$failure_count"))
success_count=$((example_count - failure_count))
success_percent=$(bc -l <<<"100*${success_count}/${example_count}")

printf \
"Successfully parsed %d of %d example files (%.1f%%)\n" \
"$success_count" "$example_count" "$success_percent"
$success_count $example_count $success_percent
104 changes: 0 additions & 104 deletions script/parse-examples.js

This file was deleted.

0 comments on commit e3002a1

Please sign in to comment.