From a0f5b00ce8812703311dbffd69096b5d2757095a Mon Sep 17 00:00:00 2001 From: xiaowei Date: Thu, 17 Dec 2020 18:51:49 +0800 Subject: [PATCH 1/4] build: remove useless compiler options --- tsconfig.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 79e5a4d..7bad3c8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,10 +17,6 @@ "include": [ "./src/**/*" ], - "exclude": [ - "./src/peg/*", - "./src/jison/*" - ], "typeAcquisition": { "include": [ "jest" From 343ce60a097bb679ee2851cb379518934420403a Mon Sep 17 00:00:00 2001 From: xiaowei Date: Thu, 17 Dec 2020 19:03:25 +0800 Subject: [PATCH 2/4] ci: integrate with gitlab-ci --- .gitlab-ci.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..44a0b0c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,45 @@ +# Read more: https://docs.gitlab.com/12.7/ee/ci/yaml/README.html +cache: + paths: + - .yarn + - node_modules/ + +before_script: + - yarn install --cache-folder .yarn + +stages: + - static-checking + - type-checking + - test + - build + +static-checking: + stage: static-checking + script: + - yarn eslint + only: + - merge_requests + - dev + +type-checking: + stage: type-checking + script: + - yarn check-types + only: + - merge_requests + - dev + +test: + stage: test + script: + - yarn test + only: + - merge_requests + - dev + +build: + stage: build + script: + - yarn build + only: + - dev diff --git a/package.json b/package.json index 2bad5a7..9a586de 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "main": "dist/index.js", "scripts": { "antlr4": "node build/antlr4.js", - "build": "npm test && rm -rf dist && tsc", + "build": "rm -rf dist && tsc", "eslint": "eslint ./src/**/*.ts", "check-types": "tsc --skipLibCheck", "test": "jest --coverage" From 6b16f752e40e4170b6a92c37a67ed330fe9ab100 Mon Sep 17 00:00:00 2001 From: Erindcl Date: Mon, 28 Dec 2020 19:07:13 +0800 Subject: [PATCH 3/4] fix: ts problem --- test/parser/plsql/listener.test.ts | 1 + test/parser/plsql/visitor.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/test/parser/plsql/listener.test.ts b/test/parser/plsql/listener.test.ts index 2b3e43e..7f7072f 100644 --- a/test/parser/plsql/listener.test.ts +++ b/test/parser/plsql/listener.test.ts @@ -10,6 +10,7 @@ describe('PLSQL Listener Tests', () => { test('Listener enterTableName', async () => { let result = ''; class MyListener extends PlSqlParserListener { + // eslint-disable-next-line camelcase enterTable_ref_list(ctx): void { result = ctx.getText().toLowerCase(); } diff --git a/test/parser/plsql/visitor.test.ts b/test/parser/plsql/visitor.test.ts index d8000b8..66026ea 100644 --- a/test/parser/plsql/visitor.test.ts +++ b/test/parser/plsql/visitor.test.ts @@ -10,6 +10,7 @@ describe('PLSQL Visitor Tests', () => { test('Visitor visitTable_ref_list', () => { let result = ''; class MyVisitor extends PlSqlParserVisitor { + // eslint-disable-next-line camelcase visitTable_ref_list(ctx): void { result = ctx.getText().toLowerCase(); super.visitTable_ref_list(ctx); From 76675e8251d272f43421e362d200ea7df4caca8e Mon Sep 17 00:00:00 2001 From: Erindcl Date: Tue, 29 Dec 2020 19:18:38 +0800 Subject: [PATCH 4/4] fix: jest command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9a586de..3662afb 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build": "rm -rf dist && tsc", "eslint": "eslint ./src/**/*.ts", "check-types": "tsc --skipLibCheck", - "test": "jest --coverage" + "test": "jest" }, "author": "dt-insight-front", "license": "ISC",