@abaplint/cli 2.113.137 → 2.113.138
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/cli.js +26 -28
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -54573,7 +54573,7 @@ class Registry {
|
|
|
54573
54573
|
}
|
|
54574
54574
|
static abaplintVersion() {
|
|
54575
54575
|
// magic, see build script "version.sh"
|
|
54576
|
-
return "2.113.
|
|
54576
|
+
return "2.113.138";
|
|
54577
54577
|
}
|
|
54578
54578
|
getDDICReferences() {
|
|
54579
54579
|
return this.ddicReferences;
|
|
@@ -77836,6 +77836,7 @@ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./nod
|
|
|
77836
77836
|
const severity_1 = __webpack_require__(/*! ../severity */ "./node_modules/@abaplint/core/build/src/severity.js");
|
|
77837
77837
|
// todo, check for cycles/circular dependencies, method findTop
|
|
77838
77838
|
// todo, add configurable error for multiple use includes
|
|
77839
|
+
const FMXXINCLUDE = /^(\/\w+\/)?L.+XX$/;
|
|
77839
77840
|
function getABAPObjects(reg) {
|
|
77840
77841
|
const ret = [];
|
|
77841
77842
|
for (const o of reg.getObjects()) {
|
|
@@ -77847,40 +77848,33 @@ function getABAPObjects(reg) {
|
|
|
77847
77848
|
}
|
|
77848
77849
|
class Graph {
|
|
77849
77850
|
constructor() {
|
|
77850
|
-
this.
|
|
77851
|
-
this.
|
|
77851
|
+
this.verticesIncludenameIndex = {};
|
|
77852
|
+
this.verticesFilenameIndex = {};
|
|
77853
|
+
this.edges = {};
|
|
77852
77854
|
}
|
|
77853
77855
|
addVertex(vertex) {
|
|
77854
|
-
this.
|
|
77856
|
+
this.verticesIncludenameIndex[vertex.includeName.toUpperCase()] = vertex;
|
|
77857
|
+
this.verticesFilenameIndex[vertex.filename.toUpperCase()] = vertex;
|
|
77855
77858
|
}
|
|
77856
|
-
|
|
77857
|
-
|
|
77858
|
-
if (v.includeName.toUpperCase() === includeName.toUpperCase()) {
|
|
77859
|
-
return v;
|
|
77860
|
-
}
|
|
77861
|
-
}
|
|
77862
|
-
return undefined;
|
|
77859
|
+
findVertexViaIncludename(includeName) {
|
|
77860
|
+
return this.verticesIncludenameIndex[includeName.toUpperCase()];
|
|
77863
77861
|
}
|
|
77864
|
-
|
|
77865
|
-
|
|
77866
|
-
if (v.filename.toUpperCase() === filename.toUpperCase()) {
|
|
77867
|
-
return v;
|
|
77868
|
-
}
|
|
77869
|
-
}
|
|
77870
|
-
return undefined;
|
|
77862
|
+
findVertexByFilename(filename) {
|
|
77863
|
+
return this.verticesFilenameIndex[filename.toUpperCase()];
|
|
77871
77864
|
}
|
|
77872
77865
|
addEdge(from, toFilename) {
|
|
77873
|
-
this.edges
|
|
77866
|
+
if (this.edges[from.filename] === undefined) {
|
|
77867
|
+
this.edges[from.filename] = [];
|
|
77868
|
+
}
|
|
77869
|
+
this.edges[from.filename].push(toFilename);
|
|
77874
77870
|
}
|
|
77875
77871
|
findTop(filename) {
|
|
77876
77872
|
const ret = [];
|
|
77877
|
-
for (const
|
|
77878
|
-
|
|
77879
|
-
ret.push(...this.findTop(e.to));
|
|
77880
|
-
}
|
|
77873
|
+
for (const to of this.edges[filename] || []) {
|
|
77874
|
+
ret.push(...this.findTop(to));
|
|
77881
77875
|
}
|
|
77882
77876
|
if (ret.length === 0) {
|
|
77883
|
-
const found = this.
|
|
77877
|
+
const found = this.findVertexByFilename(filename);
|
|
77884
77878
|
if (found !== undefined) {
|
|
77885
77879
|
ret.push(found);
|
|
77886
77880
|
}
|
|
@@ -77924,19 +77918,23 @@ class IncludeGraph {
|
|
|
77924
77918
|
this.addVertices();
|
|
77925
77919
|
for (const o of getABAPObjects(this.reg)) {
|
|
77926
77920
|
for (const f of o.getABAPFiles()) {
|
|
77921
|
+
if (f.getFilename().includes(".prog.screen_") || f.getFilename().includes(".fugr.screen_")) {
|
|
77922
|
+
// skip dynpro files
|
|
77923
|
+
continue;
|
|
77924
|
+
}
|
|
77927
77925
|
for (const s of f.getStatements()) {
|
|
77928
77926
|
if (s.get() instanceof statements_1.Include) {
|
|
77929
|
-
const ifFound = s.concatTokens().toUpperCase().includes("IF FOUND");
|
|
77930
77927
|
const iexp = s.findFirstExpression(expressions_1.IncludeName);
|
|
77931
77928
|
if (iexp === undefined) {
|
|
77932
77929
|
throw new Error("unexpected Include node");
|
|
77933
77930
|
}
|
|
77934
77931
|
const name = iexp.getFirstToken().getStr().toUpperCase();
|
|
77935
|
-
if (name.match(
|
|
77932
|
+
if (name.match(FMXXINCLUDE)) { // function module XX includes, possibily namespaced
|
|
77936
77933
|
continue;
|
|
77937
77934
|
}
|
|
77938
|
-
const found = this.graph.
|
|
77935
|
+
const found = this.graph.findVertexViaIncludename(name);
|
|
77939
77936
|
if (found === undefined) {
|
|
77937
|
+
const ifFound = s.concatTokens().toUpperCase().includes("IF FOUND");
|
|
77940
77938
|
if (ifFound === false) {
|
|
77941
77939
|
const issue = issue_1.Issue.atStatement(f, s, "Include " + name + " not found", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);
|
|
77942
77940
|
this.issues.push(issue);
|
|
@@ -77956,7 +77954,7 @@ class IncludeGraph {
|
|
|
77956
77954
|
this.findUnusedIncludes();
|
|
77957
77955
|
}
|
|
77958
77956
|
findUnusedIncludes() {
|
|
77959
|
-
for (const v of this.graph.
|
|
77957
|
+
for (const v of Object.values(this.graph.verticesFilenameIndex)) {
|
|
77960
77958
|
if (v.include === true) {
|
|
77961
77959
|
if (this.listMainForInclude(v.filename).length === 0) {
|
|
77962
77960
|
const f = this.reg.getFileByName(v.filename);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.138",
|
|
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.113.
|
|
41
|
+
"@abaplint/core": "^2.113.138",
|
|
42
42
|
"@types/chai": "^4.3.20",
|
|
43
43
|
"@types/minimist": "^1.2.5",
|
|
44
44
|
"@types/mocha": "^10.0.10",
|