@abaplint/cli 2.107.1 → 2.107.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 +93 -32
  2. package/package.json +5 -5
package/build/cli.js CHANGED
@@ -245,7 +245,7 @@ class ApplyFixes {
245
245
  const edits = [];
246
246
  const appliedIssues = [];
247
247
  for (const i of issues) {
248
- const edit = i.getFix();
248
+ const edit = i.getDefaultFix();
249
249
  if (edit === undefined) {
250
250
  continue;
251
251
  }
@@ -41254,8 +41254,8 @@ exports.MemoryFile = MemoryFile;
41254
41254
  "use strict";
41255
41255
 
41256
41256
  Object.defineProperty(exports, "__esModule", ({ value: true }));
41257
- exports.Visibility = exports.Info = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.applyEditList = exports.applyEditSingle = exports.SpaghettiScopeNode = exports.AbstractFile = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.ReferenceType = exports.Version = exports.Config = exports.Issue = exports.MemoryFile = void 0;
41258
- exports.RuleTag = exports.Severity = void 0;
41257
+ exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.applyEditList = exports.applyEditSingle = exports.SpaghettiScopeNode = exports.AbstractFile = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.ReferenceType = exports.Version = exports.Config = exports.Issue = exports.MemoryFile = void 0;
41258
+ exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = void 0;
41259
41259
  const issue_1 = __webpack_require__(/*! ./issue */ "./node_modules/@abaplint/core/build/src/issue.js");
41260
41260
  Object.defineProperty(exports, "Issue", ({ enumerable: true, get: function () { return issue_1.Issue; } }));
41261
41261
  const config_1 = __webpack_require__(/*! ./config */ "./node_modules/@abaplint/core/build/src/config.js");
@@ -41356,6 +41356,10 @@ const cyclomatic_complexity_stats_1 = __webpack_require__(/*! ./utils/cyclomatic
41356
41356
  Object.defineProperty(exports, "CyclomaticComplexityStats", ({ enumerable: true, get: function () { return cyclomatic_complexity_stats_1.CyclomaticComplexityStats; } }));
41357
41357
  const skip_logic_1 = __webpack_require__(/*! ./skip_logic */ "./node_modules/@abaplint/core/build/src/skip_logic.js");
41358
41358
  Object.defineProperty(exports, "SkipLogic", ({ enumerable: true, get: function () { return skip_logic_1.SkipLogic; } }));
41359
+ const diagnostics_1 = __webpack_require__(/*! ./lsp/diagnostics */ "./node_modules/@abaplint/core/build/src/lsp/diagnostics.js");
41360
+ Object.defineProperty(exports, "Diagnostics", ({ enumerable: true, get: function () { return diagnostics_1.Diagnostics; } }));
41361
+ const _edit_1 = __webpack_require__(/*! ./lsp/_edit */ "./node_modules/@abaplint/core/build/src/lsp/_edit.js");
41362
+ Object.defineProperty(exports, "LSPEdit", ({ enumerable: true, get: function () { return _edit_1.LSPEdit; } }));
41359
41363
  //# sourceMappingURL=index.js.map
41360
41364
 
41361
41365
  /***/ }),
@@ -41401,7 +41405,7 @@ class Issue {
41401
41405
  key,
41402
41406
  start,
41403
41407
  end,
41404
- fix,
41408
+ defaultFix: fix,
41405
41409
  severity,
41406
41410
  });
41407
41411
  }
@@ -41415,7 +41419,7 @@ class Issue {
41415
41419
  key,
41416
41420
  start,
41417
41421
  end,
41418
- fix,
41422
+ defaultFix: fix,
41419
41423
  severity,
41420
41424
  });
41421
41425
  }
@@ -41427,7 +41431,7 @@ class Issue {
41427
41431
  key,
41428
41432
  start,
41429
41433
  end,
41430
- fix,
41434
+ defaultFix: fix,
41431
41435
  severity,
41432
41436
  });
41433
41437
  }
@@ -41440,7 +41444,7 @@ class Issue {
41440
41444
  start: token.getStart(),
41441
41445
  end: token.getEnd(),
41442
41446
  severity,
41443
- fix,
41447
+ defaultFix: fix,
41444
41448
  });
41445
41449
  }
41446
41450
  static atIdentifier(identifier, message, key, severity, fix) {
@@ -41452,14 +41456,14 @@ class Issue {
41452
41456
  start: identifier.getStart(),
41453
41457
  end: identifier.getEnd(),
41454
41458
  severity,
41455
- fix,
41459
+ defaultFix: fix,
41456
41460
  });
41457
41461
  }
41458
41462
  constructor(data) {
41459
41463
  this.data = data;
41460
41464
  if (this.data.start instanceof virtual_position_1.VirtualPosition) {
41461
41465
  // no quick fixes inside macros
41462
- this.data.fix = undefined;
41466
+ this.data.defaultFix = undefined;
41463
41467
  }
41464
41468
  if (this.data.start.getCol() < 1) {
41465
41469
  throw new Error("issue, start col < 1");
@@ -41486,8 +41490,11 @@ class Issue {
41486
41490
  getFilename() {
41487
41491
  return this.data.filename;
41488
41492
  }
41489
- getFix() {
41490
- return this.data.fix;
41493
+ getDefaultFix() {
41494
+ return this.data.defaultFix;
41495
+ }
41496
+ getAlternativeFixes() {
41497
+ return this.data.alternativeFixes;
41491
41498
  }
41492
41499
  getSeverity() {
41493
41500
  return this.data.severity;
@@ -41522,22 +41529,6 @@ class LSPEdit {
41522
41529
  }
41523
41530
  return workspace;
41524
41531
  }
41525
- /*
41526
- public static mapEditsDocument(edit: IEdit): LServer.WorkspaceEdit {
41527
- const workspace: LServer.WorkspaceEdit = {documentChanges: []};
41528
- for (const filename in edit) {
41529
- const doc: LServer.VersionedTextDocumentIdentifier = {uri: filename, version: 1};
41530
-
41531
- const e = LServer.TextDocumentEdit.create(doc, this.mapText(edit[filename]));
41532
- workspace.documentChanges?.push(e);
41533
- }
41534
- // @ts-ignore
41535
- console.dir(workspace.documentChanges![0].edits[0]);
41536
- // @ts-ignore
41537
- console.dir(workspace.documentChanges![0].edits[1]);
41538
- return workspace;
41539
- }
41540
- */
41541
41532
  static mapEdit(edit) {
41542
41533
  const workspace = { changes: {} };
41543
41534
  for (const filename in edit) {
@@ -42040,7 +42031,7 @@ class CodeActions {
42040
42031
  const shown = new Set();
42041
42032
  const ret = [];
42042
42033
  for (const i of issues) {
42043
- const fix = i.getFix();
42034
+ const fix = i.getDefaultFix();
42044
42035
  if (fix === undefined) {
42045
42036
  continue;
42046
42037
  }
@@ -42075,7 +42066,7 @@ class CodeActions {
42075
42066
  const diagnostics = [];
42076
42067
  const fixes = [];
42077
42068
  for (const i of issues) {
42078
- const fix = i.getFix();
42069
+ const fix = i.getDefaultFix();
42079
42070
  if (fix === undefined) {
42080
42071
  continue;
42081
42072
  }
@@ -51462,7 +51453,7 @@ class Registry {
51462
51453
  }
51463
51454
  static abaplintVersion() {
51464
51455
  // magic, see build script "version.sh"
51465
- return "2.107.1";
51456
+ return "2.107.3";
51466
51457
  }
51467
51458
  getDDICReferences() {
51468
51459
  return this.ddicReferences;
@@ -53189,7 +53180,8 @@ STATICS BEGIN OF bar.
53189
53180
  INCLUDE STRUCTURE syst.
53190
53181
  STATICS END OF bar.`,
53191
53182
  goodExample: `DATA BEGIN OF foo.
53192
- INCLUDE STRUCTURE dselc.
53183
+ DATA field TYPE i.
53184
+ INCLUDE STRUCTURE dselc.
53193
53185
  DATA END OF foo.`,
53194
53186
  };
53195
53187
  }
@@ -53670,7 +53662,7 @@ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statement
53670
53662
  }
53671
53663
  let prevFix;
53672
53664
  if (previousRow === colon.getStart().getRow()) {
53673
- prevFix = (_a = issues.pop()) === null || _a === void 0 ? void 0 : _a.getFix();
53665
+ prevFix = (_a = issues.pop()) === null || _a === void 0 ? void 0 : _a.getDefaultFix();
53674
53666
  }
53675
53667
  const fix = this.getFix(file, statement, statementNode, prevFix);
53676
53668
  const message = "Chain mainly declarations";
@@ -55044,6 +55036,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
55044
55036
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
55045
55037
  https://docs.abapopenchecks.org/checks/14/`,
55046
55038
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
55039
+ badExample: `* WRITE 'hello world'.`,
55047
55040
  };
55048
55041
  }
55049
55042
  getMessage() {
@@ -55355,6 +55348,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
55355
55348
  https://docs.abapopenchecks.org/checks/09/
55356
55349
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
55357
55350
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55351
+ badExample: `\tWRITE 'hello world'.`,
55352
+ goodExample: ` WRITE 'hello world'.`,
55358
55353
  };
55359
55354
  }
55360
55355
  getMessage() {
@@ -59512,6 +59507,8 @@ class EmptyStatement extends _abap_rule_1.ABAPRule {
59512
59507
  title: "Remove empty statement",
59513
59508
  shortDescription: `Checks for empty statements (an empty statement is a single dot)`,
59514
59509
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
59510
+ badExample: `WRITE 'hello world'..`,
59511
+ goodExample: `WRITE 'hello world'.`,
59515
59512
  };
59516
59513
  }
59517
59514
  getConfig() {
@@ -61900,6 +61897,24 @@ class Indentation extends _abap_rule_1.ABAPRule {
61900
61897
  title: "Indentation",
61901
61898
  shortDescription: `Checks indentation`,
61902
61899
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61900
+ badExample: `CLASS lcl DEFINITION.
61901
+ PRIVATE SECTION.
61902
+ METHODS constructor.
61903
+ ENDCLASS.
61904
+
61905
+ CLASS lcl IMPLEMENTATION.
61906
+ METHOD constructor.
61907
+ ENDMETHOD.
61908
+ ENDCLASS.`,
61909
+ goodExample: `CLASS lcl DEFINITION.
61910
+ PRIVATE SECTION.
61911
+ METHODS constructor.
61912
+ ENDCLASS.
61913
+
61914
+ CLASS lcl IMPLEMENTATION.
61915
+ METHOD constructor.
61916
+ ENDMETHOD.
61917
+ ENDCLASS.`,
61903
61918
  };
61904
61919
  }
61905
61920
  getConfig() {
@@ -62713,6 +62728,8 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
62713
62728
  shortDescription: `Checks that keywords have the same case. Non-keywords must be lower case.`,
62714
62729
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-your-pretty-printer-team-settings`,
62715
62730
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
62731
+ badExample: `write 'hello world'.`,
62732
+ goodExample: `WRITE 'hello world'.`,
62716
62733
  };
62717
62734
  }
62718
62735
  getConfig() {
@@ -63374,6 +63391,12 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
63374
63391
  Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
63375
63392
  Regexes are case-insensitive.`,
63376
63393
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
63394
+ badExample: `FORM bar.
63395
+ DATA foo.
63396
+ ENDFORM.`,
63397
+ goodExample: `FORM bar.
63398
+ DATA lv_foo.
63399
+ ENDFORM.`,
63377
63400
  };
63378
63401
  }
63379
63402
  getDescription(expected, actual) {
@@ -64347,6 +64370,15 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscu
64347
64370
 
64348
64371
  Interface method names are ignored`,
64349
64372
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64373
+ badExample: `CLASS lcl DEFINITION.
64374
+ PUBLIC SECTION.
64375
+ METHODS matches.
64376
+ ENDCLASS.
64377
+
64378
+ CLASS lcl IMPLEMENTATION.
64379
+ METHOD matches.
64380
+ ENDMETHOD.
64381
+ ENDCLASS.`,
64350
64382
  };
64351
64383
  }
64352
64384
  getConfig() {
@@ -64536,6 +64568,13 @@ class MixReturning extends _abap_rule_1.ABAPRule {
64536
64568
  // eslint-disable-next-line max-len
64537
64569
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
64538
64570
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64571
+ badExample: `CLASS lcl DEFINITION.
64572
+ PUBLIC SECTION.
64573
+ METHODS
64574
+ foobar
64575
+ EXPORTING foo TYPE i
64576
+ RETURNING VALUE(rv_string) TYPE string.
64577
+ ENDCLASS.`,
64539
64578
  };
64540
64579
  }
64541
64580
  getMessage() {
@@ -67832,6 +67871,10 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
67832
67871
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67833
67872
  https://docs.abapopenchecks.org/checks/44/`,
67834
67873
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67874
+ badExample: `CLASS lcl DEFINITION.
67875
+ PUBLIC SECTION.
67876
+ METHODS test EXPORTING ev_foo TYPE i.
67877
+ ENDCLASS.`,
67835
67878
  };
67836
67879
  }
67837
67880
  getConfig() {
@@ -67999,6 +68042,10 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
67999
68042
  title: "Preferred compare operator",
68000
68043
  shortDescription: `Configure undesired operator variants`,
68001
68044
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
68045
+ badExample: `IF foo EQ bar.
68046
+ ENDIF.`,
68047
+ goodExample: `IF foo = bar.
68048
+ ENDIF.`,
68002
68049
  };
68003
68050
  }
68004
68051
  getDescription(operator) {
@@ -68712,6 +68759,8 @@ add ORDER BY PRIMARY KEY if in doubt
68712
68759
 
68713
68760
  If the target is a sorted/hashed table, no issue is reported`,
68714
68761
  tags: [_irule_1.RuleTag.SingleFile],
68762
+ badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
68763
+ goodExample: `SELECT * FROM db INTO TABLE @DATA(tab) ORDER BY PRIMARY KEY.`,
68715
68764
  };
68716
68765
  }
68717
68766
  getConfig() {
@@ -70729,6 +70778,8 @@ class TypesNaming extends _abap_rule_1.ABAPRule {
70729
70778
  shortDescription: `Allows you to enforce a pattern for TYPES definitions`,
70730
70779
  extendedInformation: `Does not run for TYPE POOLS`,
70731
70780
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
70781
+ badExample: `TYPES foo TYPE i.`,
70782
+ goodExample: `TYPES ty_foo TYPE i.`,
70732
70783
  };
70733
70784
  }
70734
70785
  getConfig() {
@@ -72704,6 +72755,16 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
72704
72755
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
72705
72756
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
72706
72757
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72758
+ badExample: `INTERFACE lif.
72759
+ METHODS load_data
72760
+ EXCEPTIONS
72761
+ invalid_parameter.
72762
+ ENDINTERFACE.`,
72763
+ goodExample: `INTERFACE lif.
72764
+ METHODS load_data
72765
+ RAISING
72766
+ cx_something.
72767
+ ENDINTERFACE.`,
72707
72768
  };
72708
72769
  }
72709
72770
  getMessage() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.107.1",
3
+ "version": "2.107.3",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,19 +38,19 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.107.1",
42
- "@types/chai": "^4.3.14",
41
+ "@abaplint/core": "^2.107.3",
42
+ "@types/chai": "^4.3.16",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.6",
46
- "@types/node": "^20.12.7",
46
+ "@types/node": "^20.12.9",
47
47
  "@types/progress": "^2.0.7",
48
48
  "chai": "^4.4.1",
49
49
  "chalk": "^5.3.0",
50
50
  "eslint": "^8.57.0",
51
51
  "glob": "^7.2.3",
52
52
  "json5": "^2.2.3",
53
- "memfs": "^4.8.2",
53
+ "memfs": "^4.9.2",
54
54
  "minimist": "^1.2.8",
55
55
  "mocha": "^10.4.0",
56
56
  "progress": "^2.0.3",