@abaplint/cli 2.113.217 → 2.113.218

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 +30 -14
  2. package/package.json +1 -1
package/build/cli.js CHANGED
@@ -437,7 +437,7 @@ class CodeClimate {
437
437
  end: issue.getEnd().getRow(),
438
438
  },
439
439
  },
440
- severity: (severityArray.includes(issue.getSeverity().toLowerCase())) ? issue.getSeverity().toLowerCase() : defaultSeverity,
440
+ severity: severityArray.includes(issue.getSeverity().toLowerCase()) ? issue.getSeverity().toLowerCase() : defaultSeverity,
441
441
  fingerprint: md5(issue.getKey() + issue.getMessage() + issue.getFilename() + issue.getStart().getRow() + issue.getEnd().getRow()),
442
442
  };
443
443
  out.push(single);
@@ -478,7 +478,7 @@ class CodeFrame {
478
478
  const builtIssues = this.convertAllIssues(issues).sort(issueSort); // Make sure it is sorted by filename for caching to work
479
479
  return [
480
480
  ...builtIssues.map(i => this.renderIssue(i)),
481
- (issues.length > 0 ? chalk_1.default.red(new total_1.Total().output(issues, fileCount)) : chalk_1.default.green(new total_1.Total().output(issues, fileCount))),
481
+ issues.length > 0 ? chalk_1.default.red(new total_1.Total().output(issues, fileCount)) : chalk_1.default.green(new total_1.Total().output(issues, fileCount)),
482
482
  ].join("\n");
483
483
  }
484
484
  convertAllIssues(issues) {
@@ -737,7 +737,7 @@ class Sonarqube {
737
737
  const single = {
738
738
  engineId: "abaplint",
739
739
  ruleId: issue.getKey(),
740
- severity: (severityArray.includes(issue.getSeverity().toUpperCase())) ? issue.getSeverity().toUpperCase() : defaultSeverity,
740
+ severity: severityArray.includes(issue.getSeverity().toUpperCase()) ? issue.getSeverity().toUpperCase() : defaultSeverity,
741
741
  type: "CODE_SMELL",
742
742
  primaryLocation: {
743
743
  message: issue.getMessage(),
@@ -1192,7 +1192,7 @@ class Rename {
1192
1192
  continue;
1193
1193
  }
1194
1194
  for (const p of rconfig.patterns || []) {
1195
- if (!(o.getType().match(p.type))) {
1195
+ if (!o.getType().match(p.type)) {
1196
1196
  continue;
1197
1197
  }
1198
1198
  const regex = new RegExp(p.oldName, "i");
@@ -23835,7 +23835,7 @@ class TypeUtils {
23835
23835
  if (!(sourceRowType instanceof basic_1.StructureType)) {
23836
23836
  return false;
23837
23837
  }
23838
- else if (!(this.structureContainsString(sourceRowType))
23838
+ else if (!this.structureContainsString(sourceRowType)
23839
23839
  && this.structureContainsVoid(sourceRowType) === false) {
23840
23840
  return false;
23841
23841
  }
@@ -23845,7 +23845,7 @@ class TypeUtils {
23845
23845
  if (!(targetRowType instanceof basic_1.StructureType)) {
23846
23846
  return false;
23847
23847
  }
23848
- else if (!(this.structureContainsString(targetRowType))
23848
+ else if (!this.structureContainsString(targetRowType)
23849
23849
  && this.structureContainsVoid(targetRowType) === false) {
23850
23850
  return false;
23851
23851
  }
@@ -25643,7 +25643,7 @@ class CorrespondingBody {
25643
25643
  }
25644
25644
  const base = (_a = node.findDirectExpression(Expressions.CorrespondingBodyBase)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source);
25645
25645
  if (base) {
25646
- source_1.Source.runSyntax(base, input);
25646
+ source_1.Source.runSyntax(base, input, targetType);
25647
25647
  }
25648
25648
  let type = undefined;
25649
25649
  for (const s of node.findDirectExpressions(Expressions.Source)) {
@@ -54549,7 +54549,7 @@ class Registry {
54549
54549
  }
54550
54550
  static abaplintVersion() {
54551
54551
  // magic, see build script "version.sh"
54552
- return "2.113.217";
54552
+ return "2.113.218";
54553
54553
  }
54554
54554
  getDDICReferences() {
54555
54555
  return this.ddicReferences;
@@ -60587,7 +60587,6 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
60587
60587
  const source = high.findExpressionAfterToken("MESSAGE");
60588
60588
  if ((source === null || source === void 0 ? void 0 : source.get()) instanceof Expressions.MessageSourceSource
60589
60589
  && ((_a = source.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Source) {
60590
- ;
60591
60590
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
60592
60591
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
60593
60592
  const firstToken = high.getFirstToken();
@@ -64019,7 +64018,7 @@ class FullyTypeConstants extends _abap_rule_1.ABAPRule {
64019
64018
  for (const stat of file.getStatements()) {
64020
64019
  if ((stat.get() instanceof Statements.Constant
64021
64020
  || (this.conf.checkData === true && stat.get() instanceof Statements.Data))
64022
- && (!this.isTyped(stat))) {
64021
+ && !this.isTyped(stat)) {
64023
64022
  const type = stat.get() instanceof Statements.Constant ? "constant definition" : "data definition";
64024
64023
  let token = (_a = stat.findFirstExpression(expressions_1.NamespaceSimpleName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
64025
64024
  if (token === undefined) {
@@ -64034,7 +64033,7 @@ class FullyTypeConstants extends _abap_rule_1.ABAPRule {
64034
64033
  return issues;
64035
64034
  }
64036
64035
  isTyped(stat) {
64037
- return (stat.findFirstExpression(expressions_1.Type) || stat.findFirstExpression(expressions_1.TypeTable));
64036
+ return stat.findFirstExpression(expressions_1.Type) || stat.findFirstExpression(expressions_1.TypeTable);
64038
64037
  }
64039
64038
  }
64040
64039
  exports.FullyTypeConstants = FullyTypeConstants;
@@ -65247,7 +65246,7 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
65247
65246
  return [idef];
65248
65247
  }
65249
65248
  for (const m of this.findInterfaceMethods(idef)) {
65250
- if (interfaceInfo.abstractMethods.includes(m.method.name.toUpperCase())) {
65249
+ if (this.isAbstract(m, interfaceInfo, def)) {
65251
65250
  continue;
65252
65251
  }
65253
65252
  if (this.isImplemented(m, def, impl) === false) {
@@ -65266,6 +65265,23 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
65266
65265
  }
65267
65266
  return ret;
65268
65267
  }
65268
+ isAbstract(m, interfaceInfo, def) {
65269
+ if (interfaceInfo.abstractMethods.includes(m.method.name.toUpperCase())) {
65270
+ return true;
65271
+ }
65272
+ if (!def.superClassName) {
65273
+ return false;
65274
+ }
65275
+ // look up in superclass if method is abstract there
65276
+ const superClass = this.findClass(def.superClassName);
65277
+ const superInterface = superClass === null || superClass === void 0 ? void 0 : superClass.def.interfaces.find(iface => iface.name.toUpperCase() === m.objectName.toUpperCase());
65278
+ if (superClass && superInterface) {
65279
+ return this.isAbstract(m, superInterface, superClass.def);
65280
+ }
65281
+ else {
65282
+ return false;
65283
+ }
65284
+ }
65269
65285
  isImplemented(m, def, impl) {
65270
65286
  if (impl === undefined) {
65271
65287
  return false;
@@ -75628,9 +75644,9 @@ ENDFORM.`,
75628
75644
  for (let i = 0; i < statements.length; i++) {
75629
75645
  const node = statements[i];
75630
75646
  const nodeType = node.get();
75631
- if ((nodeType instanceof Statements.MethodImplementation
75647
+ if (nodeType instanceof Statements.MethodImplementation
75632
75648
  || nodeType instanceof Statements.Form
75633
- || nodeType instanceof Statements.FunctionModule)) {
75649
+ || nodeType instanceof Statements.FunctionModule) {
75634
75650
  statementCounter = 0;
75635
75651
  continue;
75636
75652
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.217",
3
+ "version": "2.113.218",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {