@abaplint/core 2.107.5 → 2.108.0
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.
package/build/src/registry.js
CHANGED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlignPseudoComments = exports.AlignPseudoCommentsConf = void 0;
|
|
4
|
+
const _abap_rule_1 = require("./_abap_rule");
|
|
5
|
+
const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
6
|
+
const _irule_1 = require("./_irule");
|
|
7
|
+
const issue_1 = require("../issue");
|
|
8
|
+
const _statement_1 = require("../abap/2_statements/statements/_statement");
|
|
9
|
+
class AlignPseudoCommentsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
10
|
+
}
|
|
11
|
+
exports.AlignPseudoCommentsConf = AlignPseudoCommentsConf;
|
|
12
|
+
class AlignPseudoComments extends _abap_rule_1.ABAPRule {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.conf = new AlignPseudoCommentsConf();
|
|
16
|
+
}
|
|
17
|
+
getMetadata() {
|
|
18
|
+
return {
|
|
19
|
+
key: "align_pseudo_comments",
|
|
20
|
+
title: "Align pseudo comments",
|
|
21
|
+
shortDescription: `Align code inspector pseudo comments in statements`,
|
|
22
|
+
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
23
|
+
badExample: `WRITE 'sdf'. "#EC sdf`,
|
|
24
|
+
goodExample: `WRITE 'sdf'. "#EC sdf`,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
getConfig() {
|
|
28
|
+
return this.conf;
|
|
29
|
+
}
|
|
30
|
+
setConfig(conf) {
|
|
31
|
+
this.conf = conf;
|
|
32
|
+
}
|
|
33
|
+
runParsed(file) {
|
|
34
|
+
const issues = [];
|
|
35
|
+
let previousEnd = undefined;
|
|
36
|
+
for (const statement of file.getStatements()) {
|
|
37
|
+
if (!(statement.get() instanceof _statement_1.Comment)) {
|
|
38
|
+
previousEnd = statement.getLastToken().getEnd();
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const commentLength = statement.concatTokens().length;
|
|
42
|
+
const firstCommentToken = statement.getFirstToken();
|
|
43
|
+
if (firstCommentToken.getStr().startsWith(`"#`) === false) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
else if (previousEnd === undefined) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
else if (commentLength > 10) {
|
|
50
|
+
const expectedColumn = 72 - commentLength + 1;
|
|
51
|
+
if (previousEnd.getCol() < expectedColumn && firstCommentToken.getStart().getCol() !== expectedColumn) {
|
|
52
|
+
const message = "Align pseudo comment to column " + expectedColumn;
|
|
53
|
+
issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else if (previousEnd.getCol() < 62 && firstCommentToken.getStart().getCol() !== 62) {
|
|
57
|
+
const message = "Align pseudo comment to column 62";
|
|
58
|
+
issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return issues;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.AlignPseudoComments = AlignPseudoComments;
|
|
65
|
+
//# sourceMappingURL=align_pseudo_comments.js.map
|
package/build/src/rules/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./7bit_ascii"), exports);
|
|
18
18
|
__exportStar(require("./abapdoc"), exports);
|
|
19
19
|
__exportStar(require("./align_parameters"), exports);
|
|
20
|
+
__exportStar(require("./align_pseudo_comments"), exports);
|
|
20
21
|
__exportStar(require("./align_type_expressions"), exports);
|
|
21
22
|
__exportStar(require("./allowed_object_naming"), exports);
|
|
22
23
|
__exportStar(require("./allowed_object_types"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.108.0",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.43.
|
|
53
|
+
"@microsoft/api-extractor": "^7.43.2",
|
|
54
54
|
"@types/chai": "^4.3.16",
|
|
55
55
|
"@types/mocha": "^10.0.6",
|
|
56
|
-
"@types/node": "^20.12.
|
|
56
|
+
"@types/node": "^20.12.10",
|
|
57
57
|
"chai": "^4.4.1",
|
|
58
58
|
"eslint": "^8.57.0",
|
|
59
59
|
"mocha": "^10.4.0",
|