@abaplint/cli 2.120.54 → 2.120.56

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 +124 -8
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -12387,7 +12387,7 @@ class CallTransaction {
12387
12387
  getMatcher() {
12388
12388
  const options = (0, combi_1.seq)("OPTIONS FROM", expressions_1.Source);
12389
12389
  const messages = (0, combi_1.seq)("MESSAGES INTO", expressions_1.Target);
12390
- const auth = (0, combi_1.ver)(version_1.Release.v740sp02, (0, combi_1.seq)((0, combi_1.altPrio)("WITH", "WITHOUT"), "AUTHORITY-CHECK"));
12390
+ const auth = (0, combi_1.ver)(version_1.Release.v740sp02, (0, combi_1.seq)((0, combi_1.altPrio)("WITH", "WITHOUT"), "AUTHORITY-CHECK"), { also: combi_1.AlsoIn.OpenABAP });
12391
12391
  const perm = (0, combi_1.per)((0, combi_1.seq)("UPDATE", expressions_1.Source), "AND SKIP FIRST SCREEN", options, messages, (0, combi_1.seq)("MODE", expressions_1.Source));
12392
12392
  const ret = (0, combi_1.seq)("CALL TRANSACTION", expressions_1.Source, (0, combi_1.optPrio)(auth), (0, combi_1.optPrio)((0, combi_1.seq)("USING", expressions_1.Source)), (0, combi_1.opt)(perm));
12393
12393
  return (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, ret);
@@ -70644,7 +70644,7 @@ class Registry {
70644
70644
  }
70645
70645
  static abaplintVersion() {
70646
70646
  // magic, see build script "version.js"
70647
- return "2.120.54";
70647
+ return "2.120.56";
70648
70648
  }
70649
70649
  getDDICReferences() {
70650
70650
  return this.ddicReferences;
@@ -71583,7 +71583,7 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
71583
71583
  * CREATE OBJECT statements
71584
71584
  * RAISE EVENT statements
71585
71585
 
71586
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
71586
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#align-parameters
71587
71587
 
71588
71588
  Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
71589
71589
 
@@ -76417,7 +76417,7 @@ class ConstantClasses {
76417
76417
  key: "constant_classes",
76418
76418
  title: "Validate constant classes",
76419
76419
  shortDescription: `Checks that a class contains exactly the constants corresponding to a domain's fixed values.`,
76420
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-enumeration-classes-to-constants-interfaces`,
76420
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-enum-to-constants-interfaces`,
76421
76421
  tags: [_irule_1.RuleTag.Styleguide],
76422
76422
  };
76423
76423
  }
@@ -80608,6 +80608,10 @@ ${indentation} output = ${uniqueName}.\n`;
80608
80608
  if (!(high.get() instanceof Statements.CallTransaction)) {
80609
80609
  return undefined;
80610
80610
  }
80611
+ else if (this.lowReg.getConfig().isOpenABAP()) {
80612
+ // open-abap supports the addition
80613
+ return undefined;
80614
+ }
80611
80615
  const tokens = high.getTokens();
80612
80616
  // the lexer splits "AUTHORITY-CHECK" into three tokens: AUTHORITY, -, CHECK
80613
80617
  for (let i = 1; i < tokens.length - 3; i++) {
@@ -85035,6 +85039,7 @@ __exportStar(__webpack_require__(/*! ./prefer_inline */ "../core/build/src/rules
85035
85039
  __exportStar(__webpack_require__(/*! ./prefer_insert_into_table */ "../core/build/src/rules/prefer_insert_into_table.js"), exports);
85036
85040
  __exportStar(__webpack_require__(/*! ./prefer_is_not */ "../core/build/src/rules/prefer_is_not.js"), exports);
85037
85041
  __exportStar(__webpack_require__(/*! ./prefer_pragmas */ "../core/build/src/rules/prefer_pragmas.js"), exports);
85042
+ __exportStar(__webpack_require__(/*! ./prefer_abap_bool */ "../core/build/src/rules/prefer_abap_bool.js"), exports);
85038
85043
  __exportStar(__webpack_require__(/*! ./prefer_raise_exception_new */ "../core/build/src/rules/prefer_raise_exception_new.js"), exports);
85039
85044
  __exportStar(__webpack_require__(/*! ./prefer_returning_to_exporting */ "../core/build/src/rules/prefer_returning_to_exporting.js"), exports);
85040
85045
  __exportStar(__webpack_require__(/*! ./prefer_xsdbool */ "../core/build/src/rules/prefer_xsdbool.js"), exports);
@@ -85848,7 +85853,7 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
85848
85853
  key: "keyword_case",
85849
85854
  title: "Keyword case",
85850
85855
  shortDescription: `Checks that keywords have the same case. Non-keywords must be lower case.`,
85851
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-your-pretty-printer-team-settings`,
85856
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-your-teams-abap-formatter-settings`,
85852
85857
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
85853
85858
  badExample: `write 'hello world'.`,
85854
85859
  goodExample: `WRITE 'hello world'.`,
@@ -92328,6 +92333,116 @@ exports.PragmaStyle = PragmaStyle;
92328
92333
 
92329
92334
  /***/ },
92330
92335
 
92336
+ /***/ "../core/build/src/rules/prefer_abap_bool.js"
92337
+ /*!***************************************************!*\
92338
+ !*** ../core/build/src/rules/prefer_abap_bool.js ***!
92339
+ \***************************************************/
92340
+ (__unused_webpack_module, exports, __webpack_require__) {
92341
+
92342
+ "use strict";
92343
+
92344
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
92345
+ if (k2 === undefined) k2 = k;
92346
+ var desc = Object.getOwnPropertyDescriptor(m, k);
92347
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
92348
+ desc = { enumerable: true, get: function() { return m[k]; } };
92349
+ }
92350
+ Object.defineProperty(o, k2, desc);
92351
+ }) : (function(o, m, k, k2) {
92352
+ if (k2 === undefined) k2 = k;
92353
+ o[k2] = m[k];
92354
+ }));
92355
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
92356
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
92357
+ }) : function(o, v) {
92358
+ o["default"] = v;
92359
+ });
92360
+ var __importStar = (this && this.__importStar) || (function () {
92361
+ var ownKeys = function(o) {
92362
+ ownKeys = Object.getOwnPropertyNames || function (o) {
92363
+ var ar = [];
92364
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
92365
+ return ar;
92366
+ };
92367
+ return ownKeys(o);
92368
+ };
92369
+ return function (mod) {
92370
+ if (mod && mod.__esModule) return mod;
92371
+ var result = {};
92372
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
92373
+ __setModuleDefault(result, mod);
92374
+ return result;
92375
+ };
92376
+ })();
92377
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
92378
+ exports.PreferAbapBool = exports.PreferAbapBoolConf = void 0;
92379
+ const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
92380
+ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "../core/build/src/rules/_abap_rule.js");
92381
+ const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
92382
+ const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
92383
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
92384
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
92385
+ const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "../core/build/src/edit_helper.js");
92386
+ const FORBIDDEN_TYPES = new Set(["XFELD", "SAP_BOOL", "BOOLE_D", "FLAG"]);
92387
+ class PreferAbapBoolConf extends _basic_rule_config_1.BasicRuleConfig {
92388
+ }
92389
+ exports.PreferAbapBoolConf = PreferAbapBoolConf;
92390
+ class PreferAbapBool extends _abap_rule_1.ABAPRule {
92391
+ constructor() {
92392
+ super(...arguments);
92393
+ this.conf = new PreferAbapBoolConf();
92394
+ }
92395
+ getMetadata() {
92396
+ return {
92397
+ key: "prefer_abap_bool",
92398
+ title: "Prefer abap_bool",
92399
+ shortDescription: `Use abap_bool instead of XFELD, SAP_BOOL, BOOLE_D, FLAG for boolean variables`,
92400
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-abap_bool-for-booleans`,
92401
+ tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
92402
+ badExample: `DATA foo TYPE xfeld.`,
92403
+ goodExample: `DATA foo TYPE abap_bool.`,
92404
+ };
92405
+ }
92406
+ getConfig() {
92407
+ return this.conf;
92408
+ }
92409
+ setConfig(conf) {
92410
+ this.conf = conf;
92411
+ }
92412
+ runParsed(file) {
92413
+ const issues = [];
92414
+ const structure = file.getStructure();
92415
+ if (structure === undefined) {
92416
+ return [];
92417
+ }
92418
+ const statements = [
92419
+ ...structure.findAllStatements(Statements.Data),
92420
+ ...structure.findAllStatements(Statements.ClassData),
92421
+ ...structure.findAllStatements(Statements.Constant),
92422
+ ...structure.findAllStatements(Statements.Type),
92423
+ ...structure.findAllStatements(Statements.FieldSymbol),
92424
+ ];
92425
+ for (const stat of statements) {
92426
+ const typeNameExpr = stat.findFirstExpression(Expressions.TypeName);
92427
+ if (typeNameExpr === undefined) {
92428
+ continue;
92429
+ }
92430
+ const typeName = typeNameExpr.concatTokens().toUpperCase();
92431
+ if (FORBIDDEN_TYPES.has(typeName) === false) {
92432
+ continue;
92433
+ }
92434
+ const token = typeNameExpr.getFirstToken();
92435
+ const fix = edit_helper_1.EditHelper.replaceToken(file, token, "abap_bool");
92436
+ issues.push(issue_1.Issue.atToken(file, token, `Use abap_bool instead of ${typeName}`, this.getMetadata().key, this.conf.severity, fix));
92437
+ }
92438
+ return issues;
92439
+ }
92440
+ }
92441
+ exports.PreferAbapBool = PreferAbapBool;
92442
+ //# sourceMappingURL=prefer_abap_bool.js.map
92443
+
92444
+ /***/ },
92445
+
92331
92446
  /***/ "../core/build/src/rules/prefer_corresponding.js"
92332
92447
  /*!*******************************************************!*\
92333
92448
  !*** ../core/build/src/rules/prefer_corresponding.js ***!
@@ -92774,9 +92889,8 @@ class PreferInsertIntoTable extends _abap_rule_1.ABAPRule {
92774
92889
  key: "prefer_insert_into_table",
92775
92890
  title: "Prefer INSERT INTO TABLE over APPEND",
92776
92891
  shortDescription: `Prefer INSERT INTO TABLE over APPEND`,
92777
- extendedInformation: `INSERT INTO TABLE respects the table type, while APPEND always adds to the end regardless of table type.
92778
-
92779
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md`,
92892
+ // eslint-disable-next-line max-len
92893
+ extendedInformation: `INSERT INTO TABLE respects the table type, while APPEND always tries to add to the end. This will dump if the sort order of a sorted table would change.\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-insert-into-table-to-append-to`,
92780
92894
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
92781
92895
  badExample: `APPEND row TO itab.`,
92782
92896
  goodExample: `INSERT row INTO TABLE itab.`,
@@ -95470,6 +95584,8 @@ class SequentialBlank extends _abap_rule_1.ABAPRule {
95470
95584
  key: "sequential_blank",
95471
95585
  title: "Sequential blank lines",
95472
95586
  shortDescription: `Checks that code does not contain more than the configured number of blank lines in a row.`,
95587
+ // eslint-disable-next-line max-len
95588
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#add-a-single-blank-line-to-separate-things-but-not-more`,
95473
95589
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
95474
95590
  };
95475
95591
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.54",
3
+ "version": "2.120.56",
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.54",
42
+ "@abaplint/core": "^2.120.56",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",