@abaplint/cli 2.105.1 → 2.105.3

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 -6
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -22548,6 +22548,9 @@ class TypeUtils {
22548
22548
  }
22549
22549
  return true;
22550
22550
  }
22551
+ else if (target instanceof basic_1.CLikeType) {
22552
+ return this.isCharLikeStrict(source);
22553
+ }
22551
22554
  else if (target instanceof basic_1.VoidType || target instanceof basic_1.AnyType) {
22552
22555
  return true;
22553
22556
  }
@@ -51042,7 +51045,7 @@ class Registry {
51042
51045
  }
51043
51046
  static abaplintVersion() {
51044
51047
  // magic, see build script "version.sh"
51045
- return "2.105.1";
51048
+ return "2.105.3";
51046
51049
  }
51047
51050
  getDDICReferences() {
51048
51051
  return this.ddicReferences;
@@ -52338,7 +52341,9 @@ STATICS: use CLASS-DATA instead
52338
52341
 
52339
52342
  DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52340
52343
 
52341
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround`,
52344
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52345
+
52346
+ BREAK points`,
52342
52347
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
52343
52348
  };
52344
52349
  }
@@ -56048,6 +56053,10 @@ Make sure to test the downported code, it might not always be completely correct
56048
56053
  if (found) {
56049
56054
  return found;
56050
56055
  }
56056
+ found = this.assignComponent(low, high, lowFile, highSyntax);
56057
+ if (found) {
56058
+ return found;
56059
+ }
56051
56060
  found = this.downportRefSimple(high, lowFile, highSyntax);
56052
56061
  if (found) {
56053
56062
  return found;
@@ -57157,6 +57166,28 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57157
57166
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
57158
57167
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, ASSIGN table expr", this.getMetadata().key, this.conf.severity, fix);
57159
57168
  }
57169
+ assignComponent(low, high, lowFile, highSyntax) {
57170
+ if (!(low.get() instanceof _statement_1.Unknown)) {
57171
+ return undefined;
57172
+ }
57173
+ if (!(high.get() instanceof Statements.Assign)) {
57174
+ return undefined;
57175
+ }
57176
+ const assignSource = high.findDirectExpression(Expressions.AssignSource);
57177
+ if (assignSource === undefined || assignSource.getFirstToken().getStr().toUpperCase() !== "COMPONENT") {
57178
+ return undefined;
57179
+ }
57180
+ const componentSource = assignSource.findExpressionAfterToken("COMPONENT");
57181
+ if (componentSource === undefined || componentSource.get() instanceof Expressions.SimpleSource3) {
57182
+ return undefined;
57183
+ }
57184
+ const uniqueName = this.uniqueName(assignSource.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57185
+ const code = `DATA(${uniqueName}) = ${componentSource.concatTokens()}.\n`;
57186
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
57187
+ const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, componentSource.getFirstToken().getStart(), componentSource.getLastToken().getEnd(), uniqueName);
57188
+ const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
57189
+ return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, ASSIGN COMPONENT source", this.getMetadata().key, this.conf.severity, fix);
57190
+ }
57160
57191
  moveWithSimpleValue(low, high, lowFile) {
57161
57192
  if (!(low.get() instanceof _statement_1.Unknown)) {
57162
57193
  return undefined;
@@ -64567,17 +64598,17 @@ class NoPrefixesConf extends _basic_rule_config_1.BasicRuleConfig {
64567
64598
  constructor() {
64568
64599
  super(...arguments);
64569
64600
  /** DATA, CLASS-DATA, DATA BEGIN OF, CLASS-DATA BEGIN OF, FINAL(), DATA(), case insensitive regex */
64570
- this.data = "^[lg]._";
64601
+ this.data = "^[lg].?_";
64571
64602
  /** STATICS, STATICS BEGIN OF, case insensitive regex */
64572
64603
  this.statics = "";
64573
64604
  /** FIELD-SYMBOLS and inline FIELD-SYMBOLS(), case insensitive regex */
64574
- this.fieldSymbols = "^<l._";
64605
+ this.fieldSymbols = "^<l.?_";
64575
64606
  /** CONSTANTS, CONSTANTS BEGIN OF, case insensitive regex */
64576
64607
  this.constants = "^[lg]c_";
64577
64608
  /** TYPES, ENUM, MESH, case insensitive regex */
64578
64609
  this.types = "^ty_";
64579
64610
  /** importing, exporting, returning and changing parameters, case insensitive regex */
64580
- this.methodParameters = "^[ierc]._";
64611
+ this.methodParameters = "^[ierc].?_";
64581
64612
  // todo, public localClass: string = "";
64582
64613
  // todo, public localInterface: string = "";
64583
64614
  // todo, public functionModuleParameters: string = "";
@@ -64599,6 +64630,9 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
64599
64630
  title: "No Prefixes",
64600
64631
  shortDescription: `Dont use hungarian notation`,
64601
64632
  extendedInformation: `
64633
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64634
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
64635
+
64602
64636
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64603
64637
 
64604
64638
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
@@ -67404,6 +67438,7 @@ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@ab
67404
67438
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
67405
67439
  const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
67406
67440
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
67441
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
67407
67442
  class ReduceProceduralCodeConf extends _basic_rule_config_1.BasicRuleConfig {
67408
67443
  constructor() {
67409
67444
  super(...arguments);
@@ -67423,7 +67458,9 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
67423
67458
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
67424
67459
  extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67425
67460
 
67426
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming`,
67461
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67462
+
67463
+ Comments are not counted as statements.`,
67427
67464
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67428
67465
  badExample: `FORM foo.
67429
67466
  DATA lv_bar TYPE i.
@@ -67469,6 +67506,9 @@ ENDFORM.`,
67469
67506
  }
67470
67507
  doCount = undefined;
67471
67508
  }
67509
+ else if (statement.get() instanceof _statement_1.Comment) {
67510
+ continue;
67511
+ }
67472
67512
  else if (doCount !== undefined) {
67473
67513
  count = count + 1;
67474
67514
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.105.1",
3
+ "version": "2.105.3",
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.105.1",
41
+ "@abaplint/core": "^2.105.3",
42
42
  "@types/chai": "^4.3.11",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.5",