Skip to content

Commit

Permalink
Merge pull request #485 from semgrep/martin/upgrade-tree-sitter
Browse files Browse the repository at this point in the history
Upgrade to tree-sitter 0.22.6
  • Loading branch information
mjambon authored Jun 21, 2024
2 parents d8da300 + 962e5a9 commit dc31834
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
9 changes: 8 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ jobs:
- run: opam exec -- make install
- run: opam exec -- make -C core test
- run:
name: test languages
# A bunch of parsers fail to build with tree-sitter 0.22.6
# and need to be upgraded.
# Some parsers won't build due to 'tree-sitter generate'
# using too much memory: c-sharp, hack
# Programmers should check the list of failed languages
# printed at the end of the CI job and proceed to merge
# their PR responsibly.
name: "test languages (known to fail for some languages)"
no_output_timeout: 60m
command: opam exec -- make lang

Expand Down
2 changes: 1 addition & 1 deletion core
Submodule core updated from a3283b to c085bc
2 changes: 2 additions & 0 deletions lang/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ tree-sitter-parser.js
/*/index.js
/*/tree-sitter-parser.js
node-types.json
# Dummy grammar.js for tree-sitter 0.22.6 (see comment in Makefile.common)
/*/grammar.js

# Files generated by ocaml-tree-sitter
/*/ocaml-src
Expand Down
1 change: 1 addition & 0 deletions lang/semgrep-grammars/src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/semgrep-*/**/index.js
/semgrep-*/**/src
/semgrep-*/**/inherited
/semgrep-*/test.log
13 changes: 11 additions & 2 deletions lang/semgrep-grammars/src/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@ prep:

.PHONY: test
test:
# 'tree-sitter test' can emit a large number of repetitive error
# messages when compiling 'parser.c'.
set -e; \
for dir in $$(find . | grep 'grammar.js$$' | xargs -L1 dirname); do \
echo "Test $$dir"; \
(cd "$$dir" && tree-sitter test); \
echo "Test $$(pwd)"; \
(cd "$$dir"; \
show_log() { echo "..."; tail -n 1000 test.log; }; \
if tree-sitter test > test.log 2>&1; then \
show_log; \
else \
show_log; \
exit 1; \
fi); \
done

.PHONY: clean
Expand Down

0 comments on commit dc31834

Please sign in to comment.