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

Commit aa02a62

Browse files
author
Patrick Thomson
authored
Merge branch 'master' into gitparsing
2 parents e431922 + 0257625 commit aa02a62

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1418
-652
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dockerfile

.gitmodules

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
[submodule "vendor/hspec-expectations-pretty-diff"]
2-
path = vendor/hspec-expectations-pretty-diff
3-
url = https://github.com/rewinfrey/hspec-expectations-pretty-diff
41
[submodule "vendor/haskell-tree-sitter"]
52
path = vendor/haskell-tree-sitter
63
url = https://github.com/tree-sitter/haskell-tree-sitter.git
7-
[submodule "vendor/proto3-suite"]
8-
path = vendor/proto3-suite
9-
url = https://github.com/joshvera/proto3-suite.git
10-
[submodule "vendor/proto3-wire"]
11-
path = vendor/proto3-wire
12-
url = https://github.com/joshvera/proto3-wire.git

.hlint.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
name: Eta reduce
4040
within:
4141
- Language.Go.Assignment
42-
- Language.MiniPython.Assignment
43-
- Language.MiniRuby.Assignment
4442
- Language.PHP.Assignment
4543
- Language.Python.Assignment
4644
- Language.Ruby.Assignment

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@ install:
3535
script:
3636
- cabal new-build -j semantic-core semantic:exe:semantic
3737
- cabal new-test semantic:test semantic-core:spec
38+
- cabal new-run semantic:parse-examples
39+
40+
# Any branch linked with a pull request will be built, as well as the non-PR
41+
# branches listed below:
42+
branches:
43+
only:
44+
- master

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Please note that this project is released with a [Contributor Code of Conduct][c
1919
0. Create a new branch: `git checkout -b my-branch-name`
2020
0. Make your change, add tests, and make sure the tests still pass
2121
0. Push to your fork and [submit a pull request][pr]
22-
0. Pat your self on the back and wait for your pull request to be reviewed and merged.
22+
0. Pat yourself on the back and wait for your pull request to be reviewed and merged.
2323

2424
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
2525

@@ -28,6 +28,8 @@ Here are a few things you can do that will increase the likelihood of your pull
2828
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
2929
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
3030

31+
Please be aware that contributions to Semantic may multiple cycles of code review—we are grateful for all community involvement, but because Semantic powers real systems, we must maintain a high standard of code quality. For reasons of compatibility with production uses of Semantic within GitHub, we may also reject or require modifications to changes that would affect these systems. We may also reject patches that don't fit with our vision of the project; should this be the case, we will be clear about our rationale.
32+
3133
## Resources
3234

3335
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM haskell:8.6 as build
2+
WORKDIR /build
3+
RUN cabal new-update
4+
5+
# Build our upstream dependencies after copying in only enough to tell cabal
6+
# what they are. This will make these layers cache better even as we change the
7+
# code of semantic itself.
8+
COPY semantic.cabal .
9+
COPY cabal.project .
10+
COPY semantic-core/semantic-core.cabal ./semantic-core/
11+
COPY vendor ./vendor
12+
RUN cabal new-build --only-dependencies
13+
14+
# Once the dependencies are built, copy in the rest of the code and compile
15+
# semantic itself.
16+
COPY . /build
17+
RUN cabal new-build semantic:exe:semantic
18+
19+
# A fake `install` target until we can get `cabal new-install` to work
20+
RUN cp $(find dist-newstyle -name semantic -type f -perm -u=x) /usr/local/bin/semantic
21+
22+
# Create a fresh image containing only the compiled CLI program, so that the
23+
# image isn't bulked up by all of the extra build state.
24+
FROM debian:stretch-slim
25+
26+
RUN apt-get update && \
27+
apt-get install -y \
28+
libgmp10 \
29+
&& \
30+
apt-get autoremove -y && \
31+
apt-get clean -y && \
32+
rm -rf /var/lib/apt/lists/*
33+
34+
COPY --from=build /usr/local/bin/semantic /usr/local/bin/semantic
35+
36+
ENTRYPOINT ["/usr/local/bin/semantic"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ cabal new-run semantic -- --help
118118

119119
Architecturally, `semantic`:
120120
1. Reads blobs.
121-
2. Generates parse trees for those blobs with [tree-sitter][tree-sitter] (an incremental parsing system for programmings tools).
121+
2. Generates parse trees for those blobs with [tree-sitter][tree-sitter] (an incremental parsing system for programming tools).
122122
3. Assigns those trees into a generalized representation of syntax.
123123
4. Performs analysis, computes diffs, or just returns parse trees.
124124
5. Renders output in one of many supported formats.

cabal.project

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
packages: vendor/* vendor/proto3-suite vendor/haskell-tree-sitter/languages/* semantic.cabal semantic-core/semantic-core.cabal
1+
packages: vendor/* vendor/haskell-tree-sitter/languages/* . semantic-core
22

3-
package proto3-suite
3+
source-repository-package
4+
type: git
5+
location: https://github.com/joshvera/proto3-suite.git
6+
tag: 83f3352f0c7c94ea091e6087f60692eda9991fae
7+
8+
source-repository-package
9+
type: git
10+
location: https://github.com/joshvera/proto3-wire.git
11+
tag: 84664e22f01beb67870368f1f88ada5d0ad01f56
12+
13+
source-repository-package
14+
type: git
15+
location: https://github.com/rewinfrey/hspec-expectations-pretty-diff
16+
tag: 94af5871c24ba319f7f72fefa53c1a4d074c9a29

script/clone-example-repos

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ clone_repo "$python_examples/certbot" certbot/certbot bb8222200a8cbd39a3ce9584ce
4848
ts_examples="$dir/typescript/vendor/tree-sitter-typescript/examples"
4949
clone_repo "$ts_examples/desktop" desktop/desktop d1324f56d02dd9afca5d2e9da545905a7d41d671
5050

51+
# Java examples are disabled because the assignment code is not yet
52+
# robust and for reasons of CI celerity.
53+
5154
java_examples="$dir/java/vendor/tree-sitter-java/examples"
52-
clone_repo "$java_examples/elasticsearch" elastic/elasticsearch 4d62640bf116af7e825d89c7319a39c3f2f325b4
53-
clone_repo "$java_examples/guava" google/guava e24fddc5fff7fd36d33ea38737b6606a7e476845
54-
clone_repo "$java_examples/RxJava" ReactiveX/RxJava 8a6bf14fc9a61f7c1c0016ca217be02ca86211d2
55+
# clone_repo "$java_examples/elasticsearch" elastic/elasticsearch 4d62640bf116af7e825d89c7319a39c3f2f325b4
56+
# clone_repo "$java_examples/guava" google/guava e24fddc5fff7fd36d33ea38737b6606a7e476845
57+
# clone_repo "$java_examples/RxJava" ReactiveX/RxJava 8a6bf14fc9a61f7c1c0016ca217be02ca86211d2
5558

5659
clone_repo "$ts_examples/npm" npm/npm ee147fbbca6f2707d3b16f4fa78f4c4606b2d9b1
5760

semantic-core/semantic-core.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ library
3535
-- other-modules:
3636
-- other-extensions:
3737
build-depends: algebraic-graphs ^>= 0.3
38-
, base >= 4.11 && < 5
38+
, base >= 4.12 && < 5
3939
, containers ^>= 0.6
4040
, directory ^>= 1.3
4141
, filepath ^>= 1.4

0 commit comments

Comments
 (0)