@abaplint/core 2.87.0 → 2.88.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +6 -6
  2. package/build/src/abap/flow/flow_graph.js +7 -7
  3. package/build/src/lsp/help.js +7 -7
  4. package/build/src/registry.js +1 -1
  5. package/build/src/rules/7bit_ascii.js +2 -2
  6. package/build/src/rules/abapdoc.js +1 -1
  7. package/build/src/rules/align_parameters.js +33 -33
  8. package/build/src/rules/ambiguous_statement.js +5 -5
  9. package/build/src/rules/avoid_use.js +8 -8
  10. package/build/src/rules/begin_end_names.js +4 -4
  11. package/build/src/rules/begin_single_include.js +12 -12
  12. package/build/src/rules/call_transaction_authority_check.js +3 -3
  13. package/build/src/rules/chain_mainly_declarations.js +4 -4
  14. package/build/src/rules/check_abstract.js +2 -2
  15. package/build/src/rules/check_comments.js +4 -4
  16. package/build/src/rules/check_include.js +3 -3
  17. package/build/src/rules/check_subrc.js +8 -8
  18. package/build/src/rules/commented_code.js +1 -1
  19. package/build/src/rules/constructor_visibility_public.js +4 -4
  20. package/build/src/rules/contains_tab.js +2 -2
  21. package/build/src/rules/dangerous_statement.js +1 -1
  22. package/build/src/rules/downport.js +63 -56
  23. package/build/src/rules/exit_or_check.js +3 -3
  24. package/build/src/rules/exporting.js +1 -1
  25. package/build/src/rules/forbidden_identifier.js +1 -1
  26. package/build/src/rules/forbidden_void_type.js +2 -2
  27. package/build/src/rules/functional_writing.js +17 -17
  28. package/build/src/rules/global_class.js +9 -10
  29. package/build/src/rules/identical_conditions.js +2 -2
  30. package/build/src/rules/identical_contents.js +14 -14
  31. package/build/src/rules/identical_descriptions.js +4 -4
  32. package/build/src/rules/if_in_if.js +7 -7
  33. package/build/src/rules/implement_methods.js +3 -3
  34. package/build/src/rules/in_statement_indentation.js +11 -11
  35. package/build/src/rules/index.js +2 -2
  36. package/build/src/rules/intf_referencing_clas.js +3 -3
  37. package/build/src/rules/line_break_style.js +2 -2
  38. package/build/src/rules/line_length.js +1 -1
  39. package/build/src/rules/line_only_punc.js +1 -1
  40. package/build/src/rules/local_variable_names.js +2 -2
  41. package/build/src/rules/many_parentheses.js +10 -10
  42. package/build/src/rules/max_one_method_parameter_per_line.js +7 -7
  43. package/build/src/rules/max_one_statement.js +3 -3
  44. package/build/src/rules/method_overwrites_builtin.js +2 -2
  45. package/build/src/rules/nesting.js +1 -1
  46. package/build/src/rules/no_chained_assignment.js +1 -1
  47. package/build/src/rules/no_public_attributes.js +1 -1
  48. package/build/src/rules/no_yoda_conditions.js +4 -4
  49. package/build/src/rules/nrob_consistency.js +2 -2
  50. package/build/src/rules/obsolete_statement.js +40 -40
  51. package/build/src/rules/omit_parameter_name.js +3 -3
  52. package/build/src/rules/omit_receiving.js +13 -13
  53. package/build/src/rules/parser_702_chaining.js +2 -2
  54. package/build/src/rules/parser_error.js +2 -2
  55. package/build/src/rules/parser_missing_space.js +1 -1
  56. package/build/src/rules/{pragma_placement.js → pragma_style.js} +28 -10
  57. package/build/src/rules/prefer_inline.js +16 -16
  58. package/build/src/rules/prefer_is_not.js +7 -7
  59. package/build/src/rules/prefer_raise_exception_new.js +3 -3
  60. package/build/src/rules/prefer_returning_to_exporting.js +1 -1
  61. package/build/src/rules/prefer_xsdbool.js +2 -2
  62. package/build/src/rules/remove_descriptions.js +4 -4
  63. package/build/src/rules/rfc_error_handling.js +9 -9
  64. package/build/src/rules/select_add_order_by.js +5 -5
  65. package/build/src/rules/select_performance.js +2 -2
  66. package/build/src/rules/sicf_consistency.js +4 -4
  67. package/build/src/rules/slow_parameter_passing.js +1 -1
  68. package/build/src/rules/space_before_dot.js +2 -2
  69. package/build/src/rules/start_at_tab.js +1 -1
  70. package/build/src/rules/sy_modification.js +2 -2
  71. package/build/src/rules/tabl_enhancement_category.js +2 -2
  72. package/build/src/rules/unnecessary_pragma.js +126 -0
  73. package/build/src/rules/unused_methods.js +9 -9
  74. package/build/src/rules/unused_variables.js +6 -6
  75. package/build/src/rules/use_bool_expression.js +8 -8
  76. package/build/src/rules/use_line_exists.js +6 -6
  77. package/build/src/rules/use_new.js +4 -4
  78. package/build/src/rules/when_others_last.js +6 -6
  79. package/package.json +66 -66
  80. package/build/src/rules/check_no_handler_pragma.js +0 -81
package/package.json CHANGED
@@ -1,66 +1,66 @@
1
- {
2
- "name": "@abaplint/core",
3
- "version": "2.87.0",
4
- "description": "abaplint - Core API",
5
- "main": "build/src/index.js",
6
- "typings": "build/abaplint.d.ts",
7
- "scripts": {
8
- "lint": "eslint src/**/*.ts test/**/*.ts --format unix",
9
- "lint:fix": "eslint src/**/*.ts test/**/*.ts --format unix --fix",
10
- "compile": "tsc && sh scripts/version.sh",
11
- "test": "npm run compile && mocha --timeout 1000 && npm run lint && npm run schema && api-extractor run",
12
- "test:only": "npm run compile && mocha",
13
- "test:parallel": "npm run compile && mocha --timeout 1000 --parallel --reporter dot",
14
- "coverage": "npm run compile && c8 mocha && c8 report --reporter=html",
15
- "schema": "node scripts/schema.js > scripts/schema.ts && ts-json-schema-generator --tsconfig tsconfig_schema.json --jsDoc extended --path scripts/schema.ts > scripts/schema.json && node scripts/schema_post.js",
16
- "publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
17
- "publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public"
18
- },
19
- "mocha": {
20
- "recursive": true,
21
- "reporter": "progress",
22
- "spec": "build/test/**/*.js",
23
- "require": "source-map-support/register"
24
- },
25
- "c8": {
26
- "include": [
27
- "build/src/**/*.js"
28
- ]
29
- },
30
- "repository": {
31
- "type": "git",
32
- "url": "git+https://github.com/abaplint/abaplint.git"
33
- },
34
- "engines": {
35
- "node": ">=12.0.0"
36
- },
37
- "keywords": [
38
- "ABAP",
39
- "lint"
40
- ],
41
- "author": "Lars Hvam Petersen",
42
- "license": "MIT",
43
- "bugs": {
44
- "url": "https://github.com/abaplint/abaplint/issues"
45
- },
46
- "homepage": "https://abaplint.org",
47
- "devDependencies": {
48
- "@microsoft/api-extractor": "^7.20.0",
49
- "@types/chai": "^4.3.0",
50
- "@types/mocha": "^9.1.0",
51
- "@types/node": "^17.0.23",
52
- "chai": "^4.3.6",
53
- "eslint": "^8.12.0",
54
- "mocha": "^9.2.2",
55
- "c8": "^7.11.0",
56
- "source-map-support": "^0.5.21",
57
- "ts-json-schema-generator": "^1.0.0",
58
- "typescript": "^4.6.3"
59
- },
60
- "dependencies": {
61
- "fast-xml-parser": "^4.0.7",
62
- "json5": "^2.2.1",
63
- "vscode-languageserver-protocol": "^3.16.0",
64
- "vscode-languageserver-types": "^3.16.0"
65
- }
66
- }
1
+ {
2
+ "name": "@abaplint/core",
3
+ "version": "2.88.2",
4
+ "description": "abaplint - Core API",
5
+ "main": "build/src/index.js",
6
+ "typings": "build/abaplint.d.ts",
7
+ "scripts": {
8
+ "lint": "eslint src/**/*.ts test/**/*.ts --format unix",
9
+ "lint:fix": "eslint src/**/*.ts test/**/*.ts --format unix --fix",
10
+ "compile": "tsc && sh scripts/version.sh",
11
+ "test": "npm run compile && mocha --timeout 1000 && npm run lint && npm run schema && api-extractor run",
12
+ "test:only": "npm run compile && mocha",
13
+ "test:parallel": "npm run compile && mocha --timeout 1000 --parallel --reporter dot",
14
+ "coverage": "npm run compile && c8 mocha && c8 report --reporter=html",
15
+ "schema": "node scripts/schema.js > scripts/schema.ts && ts-json-schema-generator --tsconfig tsconfig_schema.json --jsDoc extended --path scripts/schema.ts > scripts/schema.json && node scripts/schema_post.js",
16
+ "publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
17
+ "publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public"
18
+ },
19
+ "mocha": {
20
+ "recursive": true,
21
+ "reporter": "progress",
22
+ "spec": "build/test/**/*.js",
23
+ "require": "source-map-support/register"
24
+ },
25
+ "c8": {
26
+ "include": [
27
+ "build/src/**/*.js"
28
+ ]
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/abaplint/abaplint.git"
33
+ },
34
+ "engines": {
35
+ "node": ">=12.0.0"
36
+ },
37
+ "keywords": [
38
+ "ABAP",
39
+ "lint"
40
+ ],
41
+ "author": "Lars Hvam Petersen",
42
+ "license": "MIT",
43
+ "bugs": {
44
+ "url": "https://github.com/abaplint/abaplint/issues"
45
+ },
46
+ "homepage": "https://abaplint.org",
47
+ "devDependencies": {
48
+ "@microsoft/api-extractor": "^7.21.2",
49
+ "@types/chai": "^4.3.0",
50
+ "@types/mocha": "^9.1.0",
51
+ "@types/node": "^17.0.23",
52
+ "chai": "^4.3.6",
53
+ "eslint": "^8.13.0",
54
+ "mocha": "^9.2.2",
55
+ "c8": "^7.11.0",
56
+ "source-map-support": "^0.5.21",
57
+ "ts-json-schema-generator": "^1.0.0",
58
+ "typescript": "^4.6.3"
59
+ },
60
+ "dependencies": {
61
+ "fast-xml-parser": "^4.0.7",
62
+ "json5": "^2.2.1",
63
+ "vscode-languageserver-protocol": "^3.16.0",
64
+ "vscode-languageserver-types": "^3.16.0"
65
+ }
66
+ }
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CheckNoHandlerPragma = exports.CheckNoHandlerPragmaConf = void 0;
4
- const issue_1 = require("../issue");
5
- const Statements = require("../abap/2_statements/statements");
6
- const _abap_rule_1 = require("./_abap_rule");
7
- const _basic_rule_config_1 = require("./_basic_rule_config");
8
- const _statement_1 = require("../abap/2_statements/statements/_statement");
9
- const _irule_1 = require("./_irule");
10
- class CheckNoHandlerPragmaConf extends _basic_rule_config_1.BasicRuleConfig {
11
- }
12
- exports.CheckNoHandlerPragmaConf = CheckNoHandlerPragmaConf;
13
- class CheckNoHandlerPragma extends _abap_rule_1.ABAPRule {
14
- constructor() {
15
- super(...arguments);
16
- this.conf = new CheckNoHandlerPragmaConf();
17
- }
18
- getMetadata() {
19
- return {
20
- key: "check_no_handler_pragma",
21
- title: "Check if NO_HANDLER can be removed",
22
- shortDescription: `Checks NO_HANDLER pragmas that can be removed`,
23
- tags: [_irule_1.RuleTag.SingleFile],
24
- badExample: `TRY.
25
- ...
26
- CATCH zcx_abapgit_exception ##NO_HANDLER.
27
- RETURN. " it has a handler
28
- ENDTRY.`,
29
- goodExample: `TRY.
30
- ...
31
- CATCH zcx_abapgit_exception.
32
- RETURN.
33
- ENDTRY.`,
34
- };
35
- }
36
- getConfig() {
37
- return this.conf;
38
- }
39
- setConfig(conf) {
40
- this.conf = conf;
41
- }
42
- runParsed(file) {
43
- const issues = [];
44
- let noHandler = false;
45
- const statements = file.getStatements();
46
- for (let i = 0; i < statements.length; i++) {
47
- const statement = statements[i];
48
- if (statement.get() instanceof Statements.EndTry) {
49
- noHandler = false;
50
- }
51
- else if (statement.get() instanceof _statement_1.Comment) {
52
- continue;
53
- }
54
- else if (noHandler === true && !(statement.get() instanceof Statements.Catch)) {
55
- const message = "NO_HANDLER pragma or pseudo comment can be removed";
56
- const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);
57
- issues.push(issue);
58
- noHandler = false;
59
- }
60
- else {
61
- noHandler = this.containsNoHandler(statement, statements[i + 1]);
62
- }
63
- }
64
- return issues;
65
- }
66
- containsNoHandler(statement, next) {
67
- for (const t of statement.getPragmas()) {
68
- if (t.getStr().toUpperCase() === "##NO_HANDLER") {
69
- return true;
70
- }
71
- }
72
- if (next
73
- && next.get() instanceof _statement_1.Comment
74
- && next.concatTokens().toUpperCase().includes("#EC NO_HANDLER")) {
75
- return true;
76
- }
77
- return false;
78
- }
79
- }
80
- exports.CheckNoHandlerPragma = CheckNoHandlerPragma;
81
- //# sourceMappingURL=check_no_handler_pragma.js.map