Skip to content

Commit

Permalink
Modernize/fix setup for go
Browse files Browse the repository at this point in the history
  • Loading branch information
mjambon committed Feb 18, 2021
1 parent b6ea6f9 commit 9b59bf4
Show file tree
Hide file tree
Showing 14 changed files with 4,620 additions and 1,005 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
[submodule "lang/tree-sitter-java"]
path = lang/semgrep-grammars/src/tree-sitter-java
url = https://github.com/tree-sitter/tree-sitter-java.git
[submodule "lang/semgrep-grammars/src/tree-sitter-go"]
path = lang/semgrep-grammars/src/tree-sitter-go
url = https://github.com/tree-sitter/tree-sitter-go.git
31 changes: 12 additions & 19 deletions lang/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
# ocaml-tree-sitter must have been built and installed for this to work.
#

# TODO: port to the modern setup: c, cpp
SUPPORTED_LANGUAGES = \
c \
cpp \
c-sharp \
go \
java \
javascript \
kotlin \
lua \
r \
ruby \
rust \
tsx \
typescript \
kotlin
typescript

# Languages which are set up to run parsing stats. Ideally, this is all
# the supported languages. See the 'stat' target.
Expand All @@ -27,30 +26,24 @@ STAT_LANGUAGES = \
go \
java \
javascript \
kotlin \
lua \
r \
ruby \
rust \
tsx \
typescript \
kotlin

.PHONY: build
build:
$(MAKE) -C semgrep-grammars
set -e; \
for lang in $(SUPPORTED_LANGUAGES); do $(MAKE) -C $$lang build; done

.PHONY: install
install:
set -e; \
for lang in $(SUPPORTED_LANGUAGES); do $(MAKE) -C $$lang install; done
typescript

# Build and test each language. Does not run parsing stats (see 'stat:').
.PHONY: test
test:
$(MAKE) -C semgrep-grammars test
set -e; \
for lang in $(SUPPORTED_LANGUAGES); do $(MAKE) -C $$lang test; done
for lang in $(SUPPORTED_LANGUAGES); do ./test-lang $$lang; done

.PHONY: build
build:
@echo "'make build' is no longer supported. Use 'make test'."
exit 1

.PHONY: release
release:
Expand Down
3 changes: 3 additions & 0 deletions lang/go/fyi.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
semgrep-grammars/src/tree-sitter-go/LICENSE
semgrep-grammars/src/tree-sitter-go/grammar.js
semgrep-grammars/src/semgrep-go/grammar.js
1 change: 0 additions & 1 deletion lang/go/grammar.js

This file was deleted.

21 changes: 0 additions & 21 deletions lang/go/orig/LICENSE

This file was deleted.

Loading

0 comments on commit 9b59bf4

Please sign in to comment.