Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 8b15e01

Browse files
juanjuxJuanjo Alvarez
authored andcommitted
Rename integration tests. Change Qualified roles.
Signed-off-by: Juanjo Alvarez <[email protected]>
2 parents 30d79c5 + 972a0b0 commit 8b15e01

File tree

214 files changed

+501
-360
lines changed

Some content is hidden

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

214 files changed

+501
-360
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
- docker
88

99
before_script:
10-
- CGO_ENABLED=0 go get -v gopkg.in/bblfsh/sdk.v1/...
10+
- go get -v gopkg.in/bblfsh/sdk.v1/...
1111
- bblfsh-sdk prepare-build .
1212
- go get -v -t ./...
1313

Dockerfile.build.tpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ FROM alpine:3.6
33
RUN mkdir -p /opt/driver/src && \
44
adduser $BUILD_USER -u $BUILD_UID -D -h /opt/driver/src
55

6-
RUN apk add --no-cache --update python python-dev python3 python3-dev py-pip py2-pip git build-base bash
7-
RUN pip3 install git+https://github.com/python/mypy.git@0bb2d1680e8b9522108b38d203cb73021a617e64#egg=mypy-lang
6+
RUN apk add --no-cache --update python python3 git make
87

98
WORKDIR /opt/driver/src

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ DEV_DEPS ?= native/dev_deps
22

33
test-native-internal:
44
pip3 install --user ${DEV_DEPS}/python-pydetector/ || pip3 install --user pydetector-bblfsh
5-
pip3 install --user git+https://github.com/python/mypy.git@0bb2d1680e8b9522108b38d203cb73021a617e64#egg=mypy-lang
65
cd native/python_package/test && \
76
python3 -m unittest discover
87

README.md

Lines changed: 1 addition & 1 deletion

driver/normalizer/annotation.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ var AnnotationRules = On(Any).Self(
156156
argumentsAnn,
157157
),
158158

159-
On(pyast.Attribute).Roles(uast.Identifier, uast.Expression).Children(
160-
On(pyast.Name).Roles(uast.Qualified)),
161-
162159
On(pyast.Call).Roles(uast.Function, uast.Call, uast.Expression).Children(
163160
On(HasInternalRole("args")).Roles(uast.Function, uast.Call, uast.Positional, uast.Argument, uast.Name),
164161
On(HasInternalRole("keywords")).Roles(uast.Function, uast.Call, uast.Argument, uast.Name).Children(
@@ -187,6 +184,16 @@ var AnnotationRules = On(Any).Self(
187184
On(HasInternalRole("value")).Roles(uast.Right),
188185
),
189186

187+
// a.b.c ("a" and "b" will be Qualified, "c" will be just Identifier). Python does the
188+
// reverse thing
189+
On(pyast.Attribute).Self(
190+
On(HasProperty("ctx", "Load")).Roles(uast.Qualified, uast.Identifier, uast.Expression),
191+
On(HasProperty("ctx", "Store")).Roles(uast.Identifier, uast.Expression),
192+
On(HasChild(pyast.Name)).Children(
193+
On(Any).Roles(uast.Qualified), // Identifier and Expr added on all Name(s) below
194+
),
195+
),
196+
190197
On(pyast.Expression).Roles(uast.Expression),
191198
On(pyast.Expr).Roles(uast.Expression),
192199
On(pyast.Name).Roles(uast.Identifier, uast.Expression),
File renamed without changes.

fixtures/annotations.py.native

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"status": "ok",
3+
"language": "",
34
"errors": [],
45
"ast": {
56
"PY3AST": {

fixtures/annotations.py.uast

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Status: ok
2+
Language:
23
Errors:
34
UAST:
45
Module {
File renamed without changes.

fixtures/aritmeticops.py.native

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"status": "ok",
3+
"language": "",
34
"errors": [],
45
"ast": {
56
"PY3AST": {

0 commit comments

Comments
 (0)