@abaplint/cli 2.106.8 → 2.106.9

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 (2) hide show
  1. package/build/cli.js +27 -11
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -26492,6 +26492,7 @@ const _scope_type_1 = __webpack_require__(/*! ../_scope_type */ "./node_modules/
26492
26492
  const sql_source_1 = __webpack_require__(/*! ./sql_source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/sql_source.js");
26493
26493
  const sql_compare_1 = __webpack_require__(/*! ./sql_compare */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/sql_compare.js");
26494
26494
  const sql_order_by_1 = __webpack_require__(/*! ./sql_order_by */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/sql_order_by.js");
26495
+ const dynamic_1 = __webpack_require__(/*! ./dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
26495
26496
  const isSimple = /^\w+$/;
26496
26497
  class Select {
26497
26498
  runSyntax(node, scope, filename, skipImplicitInto = false) {
@@ -26502,7 +26503,7 @@ class Select {
26502
26503
  if (from === undefined) {
26503
26504
  throw new Error(`Missing FROM`);
26504
26505
  }
26505
- const fields = this.findFields(node);
26506
+ const fields = this.findFields(node, scope, filename);
26506
26507
  if (fields.length === 0
26507
26508
  && node.findDirectExpression(Expressions.SQLFieldListLoop) === undefined) {
26508
26509
  throw new Error(`fields missing`);
@@ -26660,17 +26661,20 @@ class Select {
26660
26661
  }
26661
26662
  return new basic_1.VoidType("SELECT_todo");
26662
26663
  }
26663
- findFields(node) {
26664
- var _a;
26664
+ findFields(node, scope, filename) {
26665
+ var _a, _b;
26665
26666
  let expr = undefined;
26666
26667
  const ret = [];
26667
26668
  expr = node.findFirstExpression(Expressions.SQLFieldList);
26668
26669
  if (expr === undefined) {
26669
26670
  expr = node.findDirectExpression(Expressions.SQLFieldListLoop);
26670
26671
  }
26672
+ if (((_a = expr === null || expr === void 0 ? void 0 : expr.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Dynamic) {
26673
+ new dynamic_1.Dynamic().runSyntax(expr.getFirstChild(), scope, filename);
26674
+ }
26671
26675
  for (const field of (expr === null || expr === void 0 ? void 0 : expr.findDirectExpressionsMulti([Expressions.SQLField, Expressions.SQLFieldName])) || []) {
26672
26676
  let code = field.concatTokens().toUpperCase();
26673
- const as = ((_a = field.findDirectExpression(Expressions.SQLAsName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || "";
26677
+ const as = ((_b = field.findDirectExpression(Expressions.SQLAsName)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
26674
26678
  if (as !== "") {
26675
26679
  code = code.replace(" AS " + as, "");
26676
26680
  }
@@ -27112,13 +27116,18 @@ exports.SQLCompare = void 0;
27112
27116
  const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
27113
27117
  const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
27114
27118
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
27119
+ const dynamic_1 = __webpack_require__(/*! ./dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
27115
27120
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
27116
27121
  const sql_source_1 = __webpack_require__(/*! ./sql_source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/sql_source.js");
27117
27122
  class SQLCompare {
27118
27123
  runSyntax(node, scope, filename, tables) {
27119
- var _a;
27124
+ var _a, _b;
27120
27125
  let sourceType;
27121
27126
  let token;
27127
+ if (((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Dynamic) {
27128
+ new dynamic_1.Dynamic().runSyntax(node.getFirstChild(), scope, filename);
27129
+ return;
27130
+ }
27122
27131
  for (const s of node.findAllExpressions(Expressions.SimpleSource3)) {
27123
27132
  new source_1.Source().runSyntax(s, scope, filename);
27124
27133
  }
@@ -27144,7 +27153,7 @@ class SQLCompare {
27144
27153
  }
27145
27154
  }
27146
27155
  }
27147
- const fieldName = (_a = node.findDirectExpression(Expressions.SQLFieldName)) === null || _a === void 0 ? void 0 : _a.concatTokens();
27156
+ const fieldName = (_b = node.findDirectExpression(Expressions.SQLFieldName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
27148
27157
  if (fieldName && sourceType && token) {
27149
27158
  // check compatibility for rule sql_value_conversion
27150
27159
  const targetType = this.findType(fieldName, tables, scope);
@@ -51451,7 +51460,7 @@ class Registry {
51451
51460
  }
51452
51461
  static abaplintVersion() {
51453
51462
  // magic, see build script "version.sh"
51454
- return "2.106.8";
51463
+ return "2.106.9";
51455
51464
  }
51456
51465
  getDDICReferences() {
51457
51466
  return this.ddicReferences;
@@ -65177,6 +65186,7 @@ class NoPrefixesConf extends _basic_rule_config_1.BasicRuleConfig {
65177
65186
  this.types = "^TY_";
65178
65187
  /** importing, exporting, returning and changing parameters, case insensitive regex */
65179
65188
  this.methodParameters = "^[ICER].?_";
65189
+ this.allowIsPrefixBoolean = true;
65180
65190
  // todo, public localClass: string = "";
65181
65191
  // todo, public localInterface: string = "";
65182
65192
  // todo, public functionModuleParameters: string = "";
@@ -65321,12 +65331,18 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodi
65321
65331
  return ret;
65322
65332
  }
65323
65333
  checkMethodParameters(topNode, regex, file) {
65334
+ var _a, _b;
65324
65335
  const ret = [];
65325
65336
  for (const method of topNode.findAllStatements(Statements.MethodDef)) {
65326
- for (const def of method.findAllExpressions(Expressions.MethodParamName)) {
65327
- const name = def.concatTokens();
65328
- if (name !== "" && name.match(regex)) {
65329
- const issue = issue_1.Issue.atToken(file, def.getFirstToken(), MESSAGE, this.getMetadata().key, this.conf.severity);
65337
+ for (const param of method.findAllExpressionsMulti([Expressions.MethodDefReturning, Expressions.MethodParam])) {
65338
+ const nameToken = param === null || param === void 0 ? void 0 : param.findFirstExpression(Expressions.MethodParamName);
65339
+ const type = (_b = (_a = param === null || param === void 0 ? void 0 : param.findFirstExpression(Expressions.TypeParam)) === null || _a === void 0 ? void 0 : _a.concatTokens()) === null || _b === void 0 ? void 0 : _b.toUpperCase();
65340
+ if (this.getConfig().allowIsPrefixBoolean === true && (type === null || type === void 0 ? void 0 : type.endsWith("TYPE ABAP_BOOL"))) {
65341
+ continue;
65342
+ }
65343
+ const name = nameToken === null || nameToken === void 0 ? void 0 : nameToken.concatTokens();
65344
+ if (nameToken && name && name !== "" && name.match(regex)) {
65345
+ const issue = issue_1.Issue.atToken(file, nameToken.getFirstToken(), MESSAGE, this.getMetadata().key, this.conf.severity);
65330
65346
  ret.push(issue);
65331
65347
  }
65332
65348
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.106.8",
3
+ "version": "2.106.9",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.106.8",
41
+ "@abaplint/core": "^2.106.9",
42
42
  "@types/chai": "^4.3.14",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",