@abaplint/cli 2.120.85 → 2.120.86

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 +136 -9
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -19442,11 +19442,15 @@ class Submit {
19442
19442
  const datasetExpiration = (0, combi_1.seq)("DATASET EXPIRATION", expressions_1.Source);
19443
19443
  const coverText = (0, combi_1.seq)("COVER TEXT", expressions_1.Source);
19444
19444
  const listName = (0, combi_1.seq)("LIST NAME", expressions_1.Source);
19445
+ const listDataset = (0, combi_1.seq)("LIST DATASET", expressions_1.Source);
19446
+ const listAuthority = (0, combi_1.seq)("LIST AUTHORITY", expressions_1.Source);
19447
+ const coverPage = (0, combi_1.seq)("COVER PAGE", expressions_1.Source);
19448
+ const department = (0, combi_1.seq)("DEPARTMENT", expressions_1.Source);
19445
19449
  const keep = (0, combi_1.seq)("KEEP IN SPOOL", expressions_1.Source);
19446
19450
  const imm = (0, combi_1.seq)("IMMEDIATELY", expressions_1.Source);
19447
19451
  const dest = (0, combi_1.seq)("DESTINATION", expressions_1.Source);
19448
19452
  const language = (0, combi_1.seq)("LANGUAGE", expressions_1.Source);
19449
- const perm = (0, combi_1.per)((0, combi_1.plusPrio)(awith), selectionTable, (0, combi_1.plusPrio)(awith), (0, combi_1.plusPrio)(awith), spool, lineSize, lineCount, archive, archiveMode, receiver, user, sset, ssetp, keep, cover, imm, layout, dest, coverText, listName, language, free, newList, uss, copies, datasetExpiration, "TO SAP-SPOOL", "WITHOUT SPOOL DYNPRO", "VIA SELECTION-SCREEN", exporting, expressions_1.AndReturn, job);
19453
+ const perm = (0, combi_1.per)((0, combi_1.plusPrio)(awith), selectionTable, (0, combi_1.plusPrio)(awith), (0, combi_1.plusPrio)(awith), spool, lineSize, lineCount, archive, archiveMode, receiver, user, sset, ssetp, keep, cover, imm, layout, dest, coverText, listName, listDataset, listAuthority, coverPage, department, language, free, newList, uss, copies, datasetExpiration, "TO SAP-SPOOL", "WITHOUT SPOOL DYNPRO", "VIA SELECTION-SCREEN", exporting, expressions_1.AndReturn, job);
19450
19454
  const ret = (0, combi_1.seq)("SUBMIT", prog, (0, combi_1.opt)(perm));
19451
19455
  return (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, ret);
19452
19456
  }
@@ -29817,6 +29821,10 @@ class BasicTypes {
29817
29821
  this.input.issues.push((0, _syntax_input_1.syntaxIssue)(this.input, chain.getFirstToken(), message));
29818
29822
  return undefined;
29819
29823
  }
29824
+ else if (concat === "SY-REPID" || concat === "SYST-REPID") {
29825
+ // predefined constant in every program, not a SYST component
29826
+ return undefined;
29827
+ }
29820
29828
  return this.resolveConstantValue(chain);
29821
29829
  }
29822
29830
  throw new Error("findValue, unexpected");
@@ -72654,7 +72662,7 @@ class Registry {
72654
72662
  }
72655
72663
  static abaplintVersion() {
72656
72664
  // magic, see build script "version.js"
72657
- return "2.120.85";
72665
+ return "2.120.86";
72658
72666
  }
72659
72667
  getDDICReferences() {
72660
72668
  return this.ddicReferences;
@@ -75311,6 +75319,104 @@ exports.AbapdocParameterNames = AbapdocParameterNames;
75311
75319
 
75312
75320
  /***/ },
75313
75321
 
75322
+ /***/ "../core/build/src/rules/abapdoc_shorttext_length.js"
75323
+ /*!***********************************************************!*\
75324
+ !*** ../core/build/src/rules/abapdoc_shorttext_length.js ***!
75325
+ \***********************************************************/
75326
+ (__unused_webpack_module, exports, __webpack_require__) {
75327
+
75328
+ "use strict";
75329
+
75330
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
75331
+ exports.AbapdocShorttextLength = exports.AbapdocShorttextLengthConf = void 0;
75332
+ const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
75333
+ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "../core/build/src/rules/_abap_rule.js");
75334
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
75335
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
75336
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "../core/build/src/abap/2_statements/statements/_statement.js");
75337
+ class AbapdocShorttextLengthConf extends _basic_rule_config_1.BasicRuleConfig {
75338
+ }
75339
+ exports.AbapdocShorttextLengthConf = AbapdocShorttextLengthConf;
75340
+ const MAX_LENGTH = 60;
75341
+ class AbapdocShorttextLength extends _abap_rule_1.ABAPRule {
75342
+ constructor() {
75343
+ super(...arguments);
75344
+ this.conf = new AbapdocShorttextLengthConf();
75345
+ }
75346
+ getMetadata() {
75347
+ return {
75348
+ key: "abapdoc_shorttext_length",
75349
+ title: "ABAP Doc shorttext too long",
75350
+ shortDescription: `Reports ABAP Doc shorttexts longer than 60 characters.`,
75351
+ extendedInformation: `A shorttext is written as <p class="shorttext">...</p> or
75352
+ <p class="shorttext synchronized">...</p>, the system warns "Shorttext must not exceed 60 characters."
75353
+ if the text is longer.
75354
+
75355
+ The text may span several "! lines, line breaks count as one blank. Leading and trailing blanks are not counted,
75356
+ an entity like &lt; counts as one character.`,
75357
+ tags: [_irule_1.RuleTag.SingleFile],
75358
+ badExample: `INTERFACE zif_foo PUBLIC.
75359
+ "! <p class="shorttext synchronized">Returns the name of the selected row in the table of the view</p>
75360
+ METHODS name RETURNING VALUE(result) TYPE string.
75361
+ ENDINTERFACE.`,
75362
+ goodExample: `INTERFACE zif_foo PUBLIC.
75363
+ "! <p class="shorttext synchronized">Returns the name of the selected row</p>
75364
+ METHODS name RETURNING VALUE(result) TYPE string.
75365
+ ENDINTERFACE.`,
75366
+ };
75367
+ }
75368
+ getConfig() {
75369
+ return this.conf;
75370
+ }
75371
+ setConfig(conf) {
75372
+ this.conf = conf;
75373
+ }
75374
+ runParsed(file) {
75375
+ const issues = [];
75376
+ let block = [];
75377
+ for (const statement of file.getStatements()) {
75378
+ const token = statement.getFirstToken();
75379
+ const doc = statement.get() instanceof _statement_1.Comment && token.getStr().startsWith(`"!`);
75380
+ const previous = block[block.length - 1];
75381
+ if (doc === false || (previous !== undefined && token.getStart().getRow() !== previous.getStart().getRow() + 1)) {
75382
+ issues.push(...this.checkBlock(file, block));
75383
+ block = [];
75384
+ }
75385
+ if (doc === true) {
75386
+ block.push(token);
75387
+ }
75388
+ }
75389
+ issues.push(...this.checkBlock(file, block));
75390
+ return issues;
75391
+ }
75392
+ checkBlock(file, block) {
75393
+ const issues = [];
75394
+ if (block.length === 0) {
75395
+ return issues;
75396
+ }
75397
+ const text = block.map(t => t.getStr().substring(2)).join("\n");
75398
+ const regex = /<p\s[^>]*class\s*=\s*"shorttext(?:\s+synchronized)?"[^>]*>([\s\S]*?)<\/p>/gi;
75399
+ let match;
75400
+ while ((match = regex.exec(text)) !== null) {
75401
+ const length = this.decode(match[1].replace(/\s+/g, " ").trim()).length;
75402
+ if (length <= MAX_LENGTH) {
75403
+ continue;
75404
+ }
75405
+ const token = block[text.substring(0, match.index).split("\n").length - 1];
75406
+ const message = `Shorttext must not exceed ${MAX_LENGTH} characters, found ${length}`;
75407
+ issues.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity));
75408
+ }
75409
+ return issues;
75410
+ }
75411
+ decode(text) {
75412
+ return text.replace(/&(#\d+|#x[0-9a-fA-F]+|[a-zA-Z]+);/g, "_");
75413
+ }
75414
+ }
75415
+ exports.AbapdocShorttextLength = AbapdocShorttextLength;
75416
+ //# sourceMappingURL=abapdoc_shorttext_length.js.map
75417
+
75418
+ /***/ },
75419
+
75314
75420
  /***/ "../core/build/src/rules/add_test_attributes.js"
75315
75421
  /*!******************************************************!*\
75316
75422
  !*** ../core/build/src/rules/add_test_attributes.js ***!
@@ -76764,8 +76870,28 @@ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md
76764
76870
 
76765
76871
  BREAK points`,
76766
76872
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
76767
- badExample: `DESCRIBE TABLE items LINES count.`,
76768
- goodExample: `count = lines( items ).`,
76873
+ badExample: `DEFINE _hello.
76874
+ WRITE 'hello'.
76875
+ END-OF-DEFINITION.
76876
+
76877
+ STATICS count TYPE i.
76878
+
76879
+ TYPES ty_items TYPE STANDARD TABLE OF i WITH DEFAULT KEY.
76880
+
76881
+ BREAK-POINT.
76882
+
76883
+ TEST-SEAM seam_name.
76884
+ count = 1.
76885
+ END-TEST-SEAM.
76886
+
76887
+ DESCRIBE TABLE items LINES count.
76888
+
76889
+ EXPORT data = items TO MEMORY ID 'ZFOO'.
76890
+
76891
+ EXPORT data = items TO DATABASE indx(zz) ID 'ZFOO'.`,
76892
+ goodExample: `count = lines( items ).
76893
+
76894
+ TYPES ty_items TYPE STANDARD TABLE OF i WITH EMPTY KEY.`,
76769
76895
  };
76770
76896
  }
76771
76897
  getDescription(statement) {
@@ -91718,6 +91844,7 @@ __exportStar(__webpack_require__(/*! ./abapdoc */ "../core/build/src/rules/abapd
91718
91844
  __exportStar(__webpack_require__(/*! ./abapdoc_html_tag */ "../core/build/src/rules/abapdoc_html_tag.js"), exports);
91719
91845
  __exportStar(__webpack_require__(/*! ./abapdoc_leading_at */ "../core/build/src/rules/abapdoc_leading_at.js"), exports);
91720
91846
  __exportStar(__webpack_require__(/*! ./abapdoc_parameter_names */ "../core/build/src/rules/abapdoc_parameter_names.js"), exports);
91847
+ __exportStar(__webpack_require__(/*! ./abapdoc_shorttext_length */ "../core/build/src/rules/abapdoc_shorttext_length.js"), exports);
91721
91848
  __exportStar(__webpack_require__(/*! ./add_test_attributes */ "../core/build/src/rules/add_test_attributes.js"), exports);
91722
91849
  __exportStar(__webpack_require__(/*! ./aff_and_xml */ "../core/build/src/rules/aff_and_xml.js"), exports);
91723
91850
  __exportStar(__webpack_require__(/*! ./alias_never_reassigned */ "../core/build/src/rules/alias_never_reassigned.js"), exports);
@@ -101374,8 +101501,8 @@ class PreferRaiseMessage extends _abap_rule_1.ABAPRule {
101374
101501
  return {
101375
101502
  key: "prefer_raise_message",
101376
101503
  title: "Prefer RAISE EXCEPTION with MESSAGE",
101377
- shortDescription: `Prefer RAISE EXCEPTION with MESSAGE instead of supplying parameter TEXT`,
101378
- extendedInformation: `Reports RAISE EXCEPTION statements where parameter TEXT is supplied.
101504
+ shortDescription: `Prefer RAISE EXCEPTION with MESSAGE instead of supplying parameter TEXT or TEXTID`,
101505
+ extendedInformation: `Reports RAISE EXCEPTION statements where parameter TEXT or TEXTID is supplied.
101379
101506
 
101380
101507
  Use a message class instead, so the text is translatable and can be found via where-used.
101381
101508
 
@@ -101422,9 +101549,9 @@ Exception classes can be excluded via configuration "ignoreExceptionClasses".`,
101422
101549
  if (className === undefined || ignore.includes(className.toUpperCase())) {
101423
101550
  continue;
101424
101551
  }
101425
- const text = parameters === null || parameters === void 0 ? void 0 : parameters.findDirectExpressions(Expressions.ParameterS).find(p => { var _a; return ((_a = p.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "TEXT"; });
101426
- if (text) {
101427
- const message = "Prefer RAISE EXCEPTION with MESSAGE, " + className + " raised with parameter TEXT";
101552
+ const name = parameters === null || parameters === void 0 ? void 0 : parameters.findDirectExpressions(Expressions.ParameterS).map(p => { var _a; return (_a = p.findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase(); }).find(n => n === "TEXT" || n === "TEXTID");
101553
+ if (name) {
101554
+ const message = "Prefer RAISE EXCEPTION with MESSAGE, " + className + " raised with parameter " + name;
101428
101555
  issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
101429
101556
  }
101430
101557
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.85",
3
+ "version": "2.120.86",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.120.85",
42
+ "@abaplint/core": "^2.120.86",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",