@abaplint/cli 2.108.8 → 2.108.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 +46 -7
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -51592,7 +51592,7 @@ class Registry {
51592
51592
  }
51593
51593
  static abaplintVersion() {
51594
51594
  // magic, see build script "version.sh"
51595
- return "2.108.8";
51595
+ return "2.108.9";
51596
51596
  }
51597
51597
  getDDICReferences() {
51598
51598
  return this.ddicReferences;
@@ -54457,7 +54457,7 @@ If sy-dbcnt is checked after database statements, it is considered okay.
54457
54457
  If IS ASSIGNED is checked after assigning, it is considered okay.
54458
54458
 
54459
54459
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
54460
- tags: [_irule_1.RuleTag.SingleFile],
54460
+ tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
54461
54461
  pseudoComment: "EC CI_SUBRC",
54462
54462
  pragma: "##SUBRC_OK",
54463
54463
  };
@@ -69284,7 +69284,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
69284
69284
  exports.SelectSingleFullKey = exports.SelectSingleFullKeyConf = void 0;
69285
69285
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
69286
69286
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
69287
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
69287
69288
  const __1 = __webpack_require__(/*! .. */ "./node_modules/@abaplint/core/build/src/index.js");
69289
+ const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
69288
69290
  class SelectSingleFullKeyConf extends _basic_rule_config_1.BasicRuleConfig {
69289
69291
  constructor() {
69290
69292
  super(...arguments);
@@ -69305,7 +69307,7 @@ class SelectSingleFullKey {
69305
69307
 
69306
69308
  If the statement contains a JOIN it is not checked`,
69307
69309
  pseudoComment: "EC CI_NOORDER",
69308
- tags: [],
69310
+ tags: [_irule_1.RuleTag.Quickfix],
69309
69311
  };
69310
69312
  }
69311
69313
  initialize(reg) {
@@ -69326,6 +69328,12 @@ If the statement contains a JOIN it is not checked`,
69326
69328
  setConfig(conf) {
69327
69329
  this.conf = conf;
69328
69330
  }
69331
+ buildFix(file, statement) {
69332
+ return {
69333
+ description: `Add "#EC CI_NOORDER`,
69334
+ edit: edit_helper_1.EditHelper.insertAt(file, statement.getLastToken().getStart(), ` "#EC CI_NOORDER`),
69335
+ };
69336
+ }
69329
69337
  run(obj) {
69330
69338
  var _a, _b;
69331
69339
  if (!(obj instanceof __1.ABAPObject)) {
@@ -69387,7 +69395,8 @@ If the statement contains a JOIN it is not checked`,
69387
69395
  }
69388
69396
  }
69389
69397
  if (set.size > 0) {
69390
- issues.push(issue_1.Issue.atStatement(file, s, message, this.getMetadata().key, this.getConfig().severity));
69398
+ const fix = this.buildFix(file, s);
69399
+ issues.push(issue_1.Issue.atStatement(file, s, message, this.getMetadata().key, this.getConfig().severity, undefined, [fix]));
69391
69400
  }
69392
69401
  }
69393
69402
  }
@@ -71852,7 +71861,13 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
71852
71861
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
71853
71862
  const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
71854
71863
  const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
71864
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
71855
71865
  class UnnecessaryReturnConf extends _basic_rule_config_1.BasicRuleConfig {
71866
+ constructor() {
71867
+ super(...arguments);
71868
+ /** Allow empty METHODs + FORMs + FUNCTION-MODULEs */
71869
+ this.allowEmpty = false;
71870
+ }
71856
71871
  }
71857
71872
  exports.UnnecessaryReturnConf = UnnecessaryReturnConf;
71858
71873
  class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
@@ -71896,15 +71911,29 @@ ENDFORM.`,
71896
71911
  }
71897
71912
  const message = "Unnecessary RETURN";
71898
71913
  const statements = file.getStatements();
71914
+ let statementCounter = 0;
71899
71915
  for (let i = 0; i < statements.length; i++) {
71900
71916
  const node = statements[i];
71901
- if (!(node.get() instanceof Statements.EndMethod
71902
- || node.get() instanceof Statements.EndForm
71903
- || node.get() instanceof Statements.EndFunction)) {
71917
+ const nodeType = node.get();
71918
+ if ((nodeType instanceof Statements.MethodImplementation
71919
+ || nodeType instanceof Statements.Form
71920
+ || nodeType instanceof Statements.FunctionModule)) {
71921
+ statementCounter = 0;
71922
+ continue;
71923
+ }
71924
+ if (!(nodeType instanceof _statement_1.Comment)) {
71925
+ statementCounter++;
71926
+ }
71927
+ if (!(nodeType instanceof Statements.EndMethod
71928
+ || nodeType instanceof Statements.EndForm
71929
+ || nodeType instanceof Statements.EndFunction)) {
71904
71930
  continue;
71905
71931
  }
71906
71932
  const prev = statements[i - 1];
71907
71933
  if (prev && prev.get() instanceof Statements.Return) {
71934
+ if (this.conf.allowEmpty === true && statementCounter === 2) {
71935
+ continue;
71936
+ }
71908
71937
  const fix = edit_helper_1.EditHelper.deleteStatement(file, prev);
71909
71938
  issues.push(issue_1.Issue.atStatement(file, prev, message, this.getMetadata().key, this.getConfig().severity, fix));
71910
71939
  }
@@ -74946,6 +74975,8 @@ exports.validate = function (xmlData, options) {
74946
74975
  return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' doesn't have proper closing.", getLineNumberForPosition(xmlData, i));
74947
74976
  } else if (attrStr.trim().length > 0) {
74948
74977
  return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
74978
+ } else if (tags.length === 0) {
74979
+ return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos));
74949
74980
  } else {
74950
74981
  const otg = tags.pop();
74951
74982
  if (tagName !== otg.tagName) {
@@ -76233,10 +76264,18 @@ const parseXml = function(xmlData) {
76233
76264
  let tagContent = "";
76234
76265
  //self-closing tag
76235
76266
  if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
76267
+ if(tagName[tagName.length - 1] === "/"){ //remove trailing '/'
76268
+ tagName = tagName.substr(0, tagName.length - 1);
76269
+ jPath = jPath.substr(0, jPath.length - 1);
76270
+ tagExp = tagName;
76271
+ }else{
76272
+ tagExp = tagExp.substr(0, tagExp.length - 1);
76273
+ }
76236
76274
  i = result.closeIndex;
76237
76275
  }
76238
76276
  //unpaired tag
76239
76277
  else if(this.options.unpairedTags.indexOf(tagName) !== -1){
76278
+
76240
76279
  i = result.closeIndex;
76241
76280
  }
76242
76281
  //normal tag
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.108.8",
3
+ "version": "2.108.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.108.8",
41
+ "@abaplint/core": "^2.108.9",
42
42
  "@types/chai": "^4.3.16",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",