report error on BREAK-POINT & latest npm packages (#149)

This commit is contained in:
Lars Hvam
2022-10-07 12:11:27 +02:00
committed by GitHub
parent 2f80060ba1
commit d83ef6fd54
10 changed files with 129 additions and 58 deletions

102
package-lock.json generated
View File

@@ -9,10 +9,10 @@
"version": "0.1.0",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@abaplint/cli": "^2.93.33",
"@abaplint/runtime": "^2.1.88",
"@abaplint/transpiler": "^2.1.88",
"@abaplint/transpiler-cli": "^2.1.88"
"@abaplint/cli": "^2.93.38",
"@abaplint/runtime": "^2.2.14",
"@abaplint/transpiler": "^2.2.14",
"@abaplint/transpiler-cli": "^2.2.14"
},
"bin": {
"abap-test-runner": "bin/run.sh"
@@ -20,7 +20,7 @@
"devDependencies": {
"@types/chai": "^4.3.3",
"@types/mocha": "^10.0.0",
"@types/node": "^18.7.23",
"@types/node": "^18.8.3",
"chai": "^4.3.6",
"mocha": "^10.0.0",
"source-map-support": "^0.5.21",
@@ -28,9 +28,9 @@
}
},
"node_modules/@abaplint/cli": {
"version": "2.93.33",
"resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.93.33.tgz",
"integrity": "sha512-TArvQMiB006TasfjBCjBp3H+uNsCipFdRuOjq1uYrOOQ3QgtGkHcLIpVHYARi7vZ/bvQxJJ0dvzRxLGhLsCHSg==",
"version": "2.93.38",
"resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.93.38.tgz",
"integrity": "sha512-oeNRgQGNr1KUEHIf5NUtlF/sKswGX6yRviYbWtZ9uYHYwZoXsMiai9A+5ClDFyFfQYWHa17Ednjnj1OcSQaEGQ==",
"bin": {
"abaplint": "abaplint"
},
@@ -39,11 +39,11 @@
}
},
"node_modules/@abaplint/core": {
"version": "2.93.33",
"resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.93.33.tgz",
"integrity": "sha512-XnRciJGSXw2ImhIk9vM6cq3Q+noviUA1fVygJR897CD646WXe3p8HSteYDzCkCTcf8Y8iuI+KtS+jyaKMgy4Vw==",
"version": "2.93.38",
"resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.93.38.tgz",
"integrity": "sha512-4kZEf/6BSvawO3EqlslhTc48U/ofnx9DbzIQqc6N2qlWLOV/cdPjH60lYplNDD7OOxTLgb6TxTBMMw+f/tHDbA==",
"dependencies": {
"fast-xml-parser": "^4.0.10",
"fast-xml-parser": "^4.0.11",
"json5": "^2.2.1",
"vscode-languageserver-types": "^3.17.2"
},
@@ -52,26 +52,26 @@
}
},
"node_modules/@abaplint/runtime": {
"version": "2.1.88",
"resolved": "https://registry.npmjs.org/@abaplint/runtime/-/runtime-2.1.88.tgz",
"integrity": "sha512-T63iW3yN+j2oQVX+q4151T73xkv7V1Qpkf+XWas83N9v3YpCipuT98W7R3Q6lZ2ITmW7vuBhyrpYCzxsteMwjA==",
"version": "2.2.14",
"resolved": "https://registry.npmjs.org/@abaplint/runtime/-/runtime-2.2.14.tgz",
"integrity": "sha512-nSZf9Xzp2Qrpvj3J0lWDfyxZpLP06t5nSbNFYTKtkWZdigA0ZtOraQmFSu9yBLaPAFS/rMGt1IPwZclwt4n7vg==",
"dependencies": {
"temporal-polyfill": "^0.0.8"
}
},
"node_modules/@abaplint/transpiler": {
"version": "2.1.88",
"resolved": "https://registry.npmjs.org/@abaplint/transpiler/-/transpiler-2.1.88.tgz",
"integrity": "sha512-wpKsf5xBjxS9dpE/Ll/Nf/AWShXDwppMtxrEGBOAAIG2v3O53UPEr5bKU1j98B8Cyb/akYd9Gt6hZ//OXuu8Xw==",
"version": "2.2.14",
"resolved": "https://registry.npmjs.org/@abaplint/transpiler/-/transpiler-2.2.14.tgz",
"integrity": "sha512-FsHiw0z3L1pOyLUdWQyNF/UsuTDofPk8nFrlOGmASIwPMAg/AeEamVgTq7MiX7X106+I9qkm04UXNXhXrb3RXw==",
"dependencies": {
"@abaplint/core": "^2.93.33",
"@abaplint/core": "^2.93.38",
"source-map": "^0.7.4"
}
},
"node_modules/@abaplint/transpiler-cli": {
"version": "2.1.88",
"resolved": "https://registry.npmjs.org/@abaplint/transpiler-cli/-/transpiler-cli-2.1.88.tgz",
"integrity": "sha512-bLt6UHkHxmaU2oaw3kKHOEvgdXbhJfB2/Hk92koO8LG5zYL2O1GxtFcN0qbOvTEWem4WsUn1QYewOc/4NoRoQA==",
"version": "2.2.14",
"resolved": "https://registry.npmjs.org/@abaplint/transpiler-cli/-/transpiler-cli-2.2.14.tgz",
"integrity": "sha512-7UyCxWNulSF8HSCR07jKqG5zVgJDxsgScuV+Xnc+sljEJ/ozW2tUzto8NQRxXPeLcXcmEQmnieYyPBQYXGy82w==",
"bin": {
"abap_transpile": "abap_transpile"
}
@@ -97,9 +97,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "18.7.23",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.23.tgz",
"integrity": "sha512-DWNcCHolDq0ZKGizjx2DZjR/PqsYwAcYUJmfMWqtVU2MBMG5Mo+xFZrhGId5r/O5HOuMPyQEcM6KUBp5lBZZBg==",
"version": "18.8.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.8.3.tgz",
"integrity": "sha512-0os9vz6BpGwxGe9LOhgP/ncvYN5Tx1fNcd2TM3rD/aCGBkysb+ZWpXEocG24h6ZzOi13+VB8HndAQFezsSOw1w==",
"dev": true
},
"node_modules/@ungap/promise-all-settled": {
@@ -431,9 +431,9 @@
}
},
"node_modules/fast-xml-parser": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.10.tgz",
"integrity": "sha512-mYMMIk7Ho1QOiedyvafdyPamn1Vlda+5n95lcn0g79UiCQoLQ2xfPQ8m3pcxBMpVaftYXtoIE2wrNTjmLQnnkg==",
"version": "4.0.11",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.11.tgz",
"integrity": "sha512-4aUg3aNRR/WjQAcpceODG1C3x3lFANXRo8+1biqfieHmg9pyMt7qB4lQV/Ta6sJCTbA5vfD8fnA8S54JATiFUA==",
"dependencies": {
"strnum": "^1.0.5"
},
@@ -1183,34 +1183,34 @@
},
"dependencies": {
"@abaplint/cli": {
"version": "2.93.33",
"resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.93.33.tgz",
"integrity": "sha512-TArvQMiB006TasfjBCjBp3H+uNsCipFdRuOjq1uYrOOQ3QgtGkHcLIpVHYARi7vZ/bvQxJJ0dvzRxLGhLsCHSg=="
"version": "2.93.38",
"resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.93.38.tgz",
"integrity": "sha512-oeNRgQGNr1KUEHIf5NUtlF/sKswGX6yRviYbWtZ9uYHYwZoXsMiai9A+5ClDFyFfQYWHa17Ednjnj1OcSQaEGQ=="
},
"@abaplint/core": {
"version": "2.93.33",
"resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.93.33.tgz",
"integrity": "sha512-XnRciJGSXw2ImhIk9vM6cq3Q+noviUA1fVygJR897CD646WXe3p8HSteYDzCkCTcf8Y8iuI+KtS+jyaKMgy4Vw==",
"version": "2.93.38",
"resolved": "https://registry.npmjs.org/@abaplint/core/-/core-2.93.38.tgz",
"integrity": "sha512-4kZEf/6BSvawO3EqlslhTc48U/ofnx9DbzIQqc6N2qlWLOV/cdPjH60lYplNDD7OOxTLgb6TxTBMMw+f/tHDbA==",
"requires": {
"fast-xml-parser": "^4.0.10",
"fast-xml-parser": "^4.0.11",
"json5": "^2.2.1",
"vscode-languageserver-types": "^3.17.2"
}
},
"@abaplint/runtime": {
"version": "2.1.88",
"resolved": "https://registry.npmjs.org/@abaplint/runtime/-/runtime-2.1.88.tgz",
"integrity": "sha512-T63iW3yN+j2oQVX+q4151T73xkv7V1Qpkf+XWas83N9v3YpCipuT98W7R3Q6lZ2ITmW7vuBhyrpYCzxsteMwjA==",
"version": "2.2.14",
"resolved": "https://registry.npmjs.org/@abaplint/runtime/-/runtime-2.2.14.tgz",
"integrity": "sha512-nSZf9Xzp2Qrpvj3J0lWDfyxZpLP06t5nSbNFYTKtkWZdigA0ZtOraQmFSu9yBLaPAFS/rMGt1IPwZclwt4n7vg==",
"requires": {
"temporal-polyfill": "^0.0.8"
}
},
"@abaplint/transpiler": {
"version": "2.1.88",
"resolved": "https://registry.npmjs.org/@abaplint/transpiler/-/transpiler-2.1.88.tgz",
"integrity": "sha512-wpKsf5xBjxS9dpE/Ll/Nf/AWShXDwppMtxrEGBOAAIG2v3O53UPEr5bKU1j98B8Cyb/akYd9Gt6hZ//OXuu8Xw==",
"version": "2.2.14",
"resolved": "https://registry.npmjs.org/@abaplint/transpiler/-/transpiler-2.2.14.tgz",
"integrity": "sha512-FsHiw0z3L1pOyLUdWQyNF/UsuTDofPk8nFrlOGmASIwPMAg/AeEamVgTq7MiX7X106+I9qkm04UXNXhXrb3RXw==",
"requires": {
"@abaplint/core": "^2.93.33",
"@abaplint/core": "^2.93.38",
"source-map": "^0.7.4"
},
"dependencies": {
@@ -1222,9 +1222,9 @@
}
},
"@abaplint/transpiler-cli": {
"version": "2.1.88",
"resolved": "https://registry.npmjs.org/@abaplint/transpiler-cli/-/transpiler-cli-2.1.88.tgz",
"integrity": "sha512-bLt6UHkHxmaU2oaw3kKHOEvgdXbhJfB2/Hk92koO8LG5zYL2O1GxtFcN0qbOvTEWem4WsUn1QYewOc/4NoRoQA=="
"version": "2.2.14",
"resolved": "https://registry.npmjs.org/@abaplint/transpiler-cli/-/transpiler-cli-2.2.14.tgz",
"integrity": "sha512-7UyCxWNulSF8HSCR07jKqG5zVgJDxsgScuV+Xnc+sljEJ/ozW2tUzto8NQRxXPeLcXcmEQmnieYyPBQYXGy82w=="
},
"@types/chai": {
"version": "4.3.3",
@@ -1239,9 +1239,9 @@
"dev": true
},
"@types/node": {
"version": "18.7.23",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.23.tgz",
"integrity": "sha512-DWNcCHolDq0ZKGizjx2DZjR/PqsYwAcYUJmfMWqtVU2MBMG5Mo+xFZrhGId5r/O5HOuMPyQEcM6KUBp5lBZZBg==",
"version": "18.8.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.8.3.tgz",
"integrity": "sha512-0os9vz6BpGwxGe9LOhgP/ncvYN5Tx1fNcd2TM3rD/aCGBkysb+ZWpXEocG24h6ZzOi13+VB8HndAQFezsSOw1w==",
"dev": true
},
"@ungap/promise-all-settled": {
@@ -1489,9 +1489,9 @@
"dev": true
},
"fast-xml-parser": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.10.tgz",
"integrity": "sha512-mYMMIk7Ho1QOiedyvafdyPamn1Vlda+5n95lcn0g79UiCQoLQ2xfPQ8m3pcxBMpVaftYXtoIE2wrNTjmLQnnkg==",
"version": "4.0.11",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.11.tgz",
"integrity": "sha512-4aUg3aNRR/WjQAcpceODG1C3x3lFANXRo8+1biqfieHmg9pyMt7qB4lQV/Ta6sJCTbA5vfD8fnA8S54JATiFUA==",
"requires": {
"strnum": "^1.0.5"
}

View File

@@ -26,10 +26,10 @@
"require": "source-map-support/register"
},
"dependencies": {
"@abaplint/transpiler-cli": "^2.1.88",
"@abaplint/transpiler": "^2.1.88",
"@abaplint/cli": "^2.93.33",
"@abaplint/runtime": "^2.1.88"
"@abaplint/transpiler-cli": "^2.2.14",
"@abaplint/transpiler": "^2.2.14",
"@abaplint/cli": "^2.93.38",
"@abaplint/runtime": "^2.2.14"
},
"devDependencies": {
"@types/chai": "^4.3.3",
@@ -38,6 +38,6 @@
"mocha": "^10.0.0",
"source-map-support": "^0.5.21",
"typescript": "^4.8.4",
"@types/node": "^18.7.23"
"@types/node": "^18.8.3"
}
}

View File

@@ -72,6 +72,8 @@ class Runner {
private syntaxAndDownport() {
const LINT_RESULT = "_abaplint.txt";
const abaplintConfig = Transpiler.config;
abaplintConfig.rules["avoid_use"] = false; // this will be caught later by the transpiler
abaplintConfig.rules["implement_methods"] = false; // this will be caught later by the transpiler
abaplintConfig.rules["downport"] = true; // https://rules.abaplint.org/downport/
abaplintConfig.rules["definitions_top"] = true; // https://rules.abaplint.org/definitions_top/
fs.writeFileSync(path.join(this.tmpDir, "abaplint.json"), JSON.stringify(abaplintConfig, null, 2));

View File

@@ -80,4 +80,12 @@ describe('abap-test-runner', async () => {
it('structure-fail', async () => {
test("structure-fail", "fail");
});
it('break-point-error', async () => {
test("break-point-error", "error");
});
it('implement-method-error', async () => {
test("implement-method-error", "error");
});
});

View File

@@ -0,0 +1 @@
{"version":2,"status":"error","tests":[],"message":"Transpiler CLI\nUsing config: abap_transpile.json\n78 files added\n0 files skipped\n\nBuilding\nError: avoid_use, Avoid use of BREAK/BREAK-POINT, zcl_simple.clas.abap:9"}

View File

@@ -0,0 +1,13 @@
CLASS zcl_simple DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS run RETURNING VALUE(res) TYPE i.
ENDCLASS.
CLASS zcl_simple IMPLEMENTATION.
METHOD run.
BREAK-POINT.
res = 3.
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,18 @@
CLASS ltcl_simple DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
PRIVATE SECTION.
METHODS test FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_simple IMPLEMENTATION.
METHOD test.
DATA simple TYPE REF TO zcl_simple.
CREATE OBJECT simple.
cl_abap_unit_assert=>assert_equals(
act = simple->run( )
exp = 3 ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1 @@
{"version":2,"status":"error","tests":[],"message":"Transpiler CLI\nUsing config: abap_transpile.json\n78 files added\n0 files skipped\n\nBuilding\nError: implement_methods, Implement method \"run\", zcl_simple.clas.abap:6"}

View File

@@ -0,0 +1,10 @@
CLASS zcl_simple DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS run RETURNING VALUE(res) TYPE i.
ENDCLASS.
CLASS zcl_simple IMPLEMENTATION.
ENDCLASS.

View File

@@ -0,0 +1,18 @@
CLASS ltcl_simple DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
PRIVATE SECTION.
METHODS test FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_simple IMPLEMENTATION.
METHOD test.
DATA simple TYPE REF TO zcl_simple.
CREATE OBJECT simple.
cl_abap_unit_assert=>assert_equals(
act = simple->run( )
exp = 3 ).
ENDMETHOD.
ENDCLASS.