@abaplint/cli 2.120.44 → 2.120.45

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 +79 -11
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -36347,6 +36347,19 @@ class ValueBody {
36347
36347
  const message = "VALUE, source type CharacterType not compatible with StringType";
36348
36348
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
36349
36349
  }
36350
+ else if (this.insertsUsingTableKey(targetType)) {
36351
+ // only STANDARD tables append the rows, and thus allow padding of shorter c and x values
36352
+ const row = this.characterOrHexLength(rowType);
36353
+ const source = this.characterOrHexLength(sourceType);
36354
+ if (row !== undefined
36355
+ && source !== undefined
36356
+ && row.abap === source.abap
36357
+ && row.length !== source.length) {
36358
+ const message = `VALUE, source type ${source.abap} LENGTH ${source.length} not compatible ` +
36359
+ `with row type ${row.abap} LENGTH ${row.length}`;
36360
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
36361
+ }
36362
+ }
36350
36363
  }
36351
36364
  }
36352
36365
  if (letScoped === true) {
@@ -36360,6 +36373,25 @@ class ValueBody {
36360
36373
  }
36361
36374
  return targetType ? targetType : type;
36362
36375
  }
36376
+ /** SORTED and HASHED tables insert the constructed rows using the table key, which
36377
+ * requires the rows to be compatible with the row type. STANDARD tables only append
36378
+ * the rows, so shorter c and x values are padded on the right instead. */
36379
+ static insertsUsingTableKey(targetType) {
36380
+ if (!(targetType instanceof basic_1.TableType)) {
36381
+ return false;
36382
+ }
36383
+ const accessType = targetType.getAccessType();
36384
+ return accessType === basic_1.TableAccessType.sorted || accessType === basic_1.TableAccessType.hashed;
36385
+ }
36386
+ static characterOrHexLength(type) {
36387
+ if (type instanceof basic_1.CharacterType) {
36388
+ return { abap: "c", length: type.getLength() };
36389
+ }
36390
+ else if (type instanceof basic_1.HexType) {
36391
+ return { abap: "x", length: type.getLength() };
36392
+ }
36393
+ return undefined;
36394
+ }
36363
36395
  }
36364
36396
  exports.ValueBody = ValueBody;
36365
36397
  //# sourceMappingURL=value_body.js.map
@@ -68679,6 +68711,20 @@ class Table extends _abstract_object_1.AbstractObject {
68679
68711
  }
68680
68712
  return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tableCategory;
68681
68713
  }
68714
+ getDeliveryClass() {
68715
+ var _a;
68716
+ if (this.parsedData === undefined) {
68717
+ this.parseXML();
68718
+ }
68719
+ return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.deliveryClass;
68720
+ }
68721
+ getSizeCategory() {
68722
+ var _a;
68723
+ if (this.parsedData === undefined) {
68724
+ this.parseXML();
68725
+ }
68726
+ return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.sizeCategory;
68727
+ }
68682
68728
  getEnhancementCategory() {
68683
68729
  var _a;
68684
68730
  if (this.parsedData === undefined) {
@@ -68706,7 +68752,7 @@ class Table extends _abstract_object_1.AbstractObject {
68706
68752
  return false;
68707
68753
  }
68708
68754
  parseXML() {
68709
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
68755
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
68710
68756
  const parsed = super.parseRaw2();
68711
68757
  if (parsed === undefined) {
68712
68758
  return;
@@ -68726,8 +68772,10 @@ class Table extends _abstract_object_1.AbstractObject {
68726
68772
  this.parsedData.tableCategory = (_m = (_l = (_k = (_j = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _j === void 0 ? void 0 : _j["asx:abap"]) === null || _k === void 0 ? void 0 : _k["asx:values"]) === null || _l === void 0 ? void 0 : _l.DD02V) === null || _m === void 0 ? void 0 : _m.TABCLASS;
68727
68773
  this.parsedData.description = (_r = (_q = (_p = (_o = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _o === void 0 ? void 0 : _o["asx:abap"]) === null || _p === void 0 ? void 0 : _p["asx:values"]) === null || _q === void 0 ? void 0 : _q.DD02V) === null || _r === void 0 ? void 0 : _r.DDTEXT;
68728
68774
  this.parsedData.dataClass = (_v = (_u = (_t = (_s = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _s === void 0 ? void 0 : _s["asx:abap"]) === null || _t === void 0 ? void 0 : _t["asx:values"]) === null || _u === void 0 ? void 0 : _u.DD09L) === null || _v === void 0 ? void 0 : _v.TABART;
68775
+ this.parsedData.deliveryClass = (_z = (_y = (_x = (_w = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _w === void 0 ? void 0 : _w["asx:abap"]) === null || _x === void 0 ? void 0 : _x["asx:values"]) === null || _y === void 0 ? void 0 : _y.DD02V) === null || _z === void 0 ? void 0 : _z.CONTFLAG;
68776
+ this.parsedData.sizeCategory = (_3 = (_2 = (_1 = (_0 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _0 === void 0 ? void 0 : _0["asx:abap"]) === null || _1 === void 0 ? void 0 : _1["asx:values"]) === null || _2 === void 0 ? void 0 : _2.DD09L) === null || _3 === void 0 ? void 0 : _3.TABKAT;
68729
68777
  // fields
68730
- const fields = (_y = (_x = (_w = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _w === void 0 ? void 0 : _w["asx:abap"]) === null || _x === void 0 ? void 0 : _x["asx:values"]) === null || _y === void 0 ? void 0 : _y.DD03P_TABLE;
68778
+ const fields = (_6 = (_5 = (_4 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _4 === void 0 ? void 0 : _4["asx:abap"]) === null || _5 === void 0 ? void 0 : _5["asx:values"]) === null || _6 === void 0 ? void 0 : _6.DD03P_TABLE;
68731
68779
  for (const field of (0, xml_utils_1.xmlToArray)(fields === null || fields === void 0 ? void 0 : fields.DD03P)) {
68732
68780
  if (typeof (field === null || field === void 0 ? void 0 : field.FIELDNAME) !== "string") {
68733
68781
  continue;
@@ -68751,13 +68799,13 @@ class Table extends _abstract_object_1.AbstractObject {
68751
68799
  });
68752
68800
  }
68753
68801
  // secondary indexes
68754
- const indexes = (_1 = (_0 = (_z = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _z === void 0 ? void 0 : _z["asx:abap"]) === null || _0 === void 0 ? void 0 : _0["asx:values"]) === null || _1 === void 0 ? void 0 : _1.DD12V;
68802
+ const indexes = (_9 = (_8 = (_7 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _7 === void 0 ? void 0 : _7["asx:abap"]) === null || _8 === void 0 ? void 0 : _8["asx:values"]) === null || _9 === void 0 ? void 0 : _9.DD12V;
68755
68803
  ;
68756
68804
  this.parsedData.secondaryIndexes = [];
68757
68805
  for (const index of (0, xml_utils_1.xmlToArray)(indexes === null || indexes === void 0 ? void 0 : indexes.DD12V)) {
68758
68806
  const indexName = index.INDEXNAME;
68759
68807
  const indexFields = [];
68760
- const indexFieldsXml = (_4 = (_3 = (_2 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _2 === void 0 ? void 0 : _2["asx:abap"]) === null || _3 === void 0 ? void 0 : _3["asx:values"]) === null || _4 === void 0 ? void 0 : _4.DD17V;
68808
+ const indexFieldsXml = (_12 = (_11 = (_10 = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _10 === void 0 ? void 0 : _10["asx:abap"]) === null || _11 === void 0 ? void 0 : _11["asx:values"]) === null || _12 === void 0 ? void 0 : _12.DD17V;
68761
68809
  for (const indexField of (0, xml_utils_1.xmlToArray)(indexFieldsXml === null || indexFieldsXml === void 0 ? void 0 : indexFieldsXml.DD17V)) {
68762
68810
  if (indexField.INDEXNAME === indexName) {
68763
68811
  // assumption: fields are listed by POSITION in the xml
@@ -70295,7 +70343,7 @@ class Registry {
70295
70343
  }
70296
70344
  static abaplintVersion() {
70297
70345
  // magic, see build script "version.js"
70298
- return "2.120.44";
70346
+ return "2.120.45";
70299
70347
  }
70300
70348
  getDDICReferences() {
70301
70349
  return this.ddicReferences;
@@ -85668,6 +85716,7 @@ exports.LineBreakStyle = exports.LineBreakStyleConf = void 0;
85668
85716
  const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
85669
85717
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
85670
85718
  const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
85719
+ const objects_1 = __webpack_require__(/*! ../objects */ "../core/build/src/objects/index.js");
85671
85720
  class LineBreakStyleConf extends _basic_rule_config_1.BasicRuleConfig {
85672
85721
  }
85673
85722
  exports.LineBreakStyleConf = LineBreakStyleConf;
@@ -85678,10 +85727,11 @@ class LineBreakStyle {
85678
85727
  getMetadata() {
85679
85728
  return {
85680
85729
  key: "line_break_style",
85681
- title: "Makes sure line breaks are consistent in the ABAP code",
85682
- shortDescription: `Enforces LF as newlines in ABAP files
85730
+ title: "Makes sure line breaks are consistent",
85731
+ shortDescription: `Enforces LF as newlines in ABAP and XML files
85683
85732
 
85684
85733
  abapGit does not work with CRLF`,
85734
+ extendedInformation: `SMIM and W3MI files are not checked.`,
85685
85735
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
85686
85736
  };
85687
85737
  }
@@ -85696,8 +85746,15 @@ abapGit does not work with CRLF`,
85696
85746
  }
85697
85747
  run(obj) {
85698
85748
  const output = [];
85749
+ if (obj instanceof objects_1.MIMEObject || obj instanceof objects_1.WebMIME) {
85750
+ return output;
85751
+ }
85699
85752
  for (const file of obj.getFiles()) {
85700
- if (file.getFilename().endsWith(".abap")) {
85753
+ const filename = file.getFilename();
85754
+ if (filename.endsWith(".abap") || filename.endsWith(".xml")) {
85755
+ if (filename.endsWith(".xslt.source.xml")) {
85756
+ continue;
85757
+ }
85701
85758
  const rows = file.getRawRows();
85702
85759
  for (let i = 0; i < rows.length; i++) {
85703
85760
  if (rows[i].endsWith("\r") === true) {
@@ -100223,6 +100280,7 @@ class XMLConsistency {
100223
100280
  * XML is well-formed and parseable
100224
100281
  * Naming for CLAS and INTF objects
100225
100282
  * QUAN fields in TABL objects have reference table and field values
100283
+ * Transparent TABL objects have delivery class and size category set
100226
100284
  * Lock parameter names in ENQU objects are max 16 characters
100227
100285
  * Texts and translations do not exceed maximum allowed length.`,
100228
100286
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.Syntax],
@@ -100481,15 +100539,25 @@ class XMLConsistency {
100481
100539
  return issues;
100482
100540
  }
100483
100541
  runTable(obj, file) {
100484
- var _a, _b;
100485
- var _c;
100542
+ var _a, _b, _c, _d;
100543
+ var _e;
100486
100544
  const issues = [];
100487
- for (const field of (_c = obj.getFields()) !== null && _c !== void 0 ? _c : []) {
100545
+ for (const field of (_e = obj.getFields()) !== null && _e !== void 0 ? _e : []) {
100488
100546
  if (field.DATATYPE === "QUAN" && (!((_a = field.REFTABLE) === null || _a === void 0 ? void 0 : _a.trim()) || !((_b = field.REFFIELD) === null || _b === void 0 ? void 0 : _b.trim()))) {
100489
100547
  const message = `QUAN field ${field.FIELDNAME} must have REFTABLE and REFFIELD set`;
100490
100548
  issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.severity));
100491
100549
  }
100492
100550
  }
100551
+ if (obj.getTableCategory() === Objects.TableCategory.Transparent) {
100552
+ if (!((_c = obj.getDeliveryClass()) === null || _c === void 0 ? void 0 : _c.trim())) {
100553
+ const message = `Transparent table must have delivery class(CONTFLAG in DD02V) set`;
100554
+ issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.severity));
100555
+ }
100556
+ if (!((_d = obj.getSizeCategory()) === null || _d === void 0 ? void 0 : _d.trim())) {
100557
+ const message = `Transparent table must have size category(TABKAT in DD09L) set`;
100558
+ issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.severity));
100559
+ }
100560
+ }
100493
100561
  return issues;
100494
100562
  }
100495
100563
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.44",
3
+ "version": "2.120.45",
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.44",
42
+ "@abaplint/core": "^2.120.45",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",