@abaplint/core
Version:
abaplint - Core API
58 lines • 1.79 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReleaseIdoc = exports.ReleaseIdocConf = void 0;
const issue_1 = require("../issue");
const _basic_rule_config_1 = require("./_basic_rule_config");
const Objects = require("../objects");
const position_1 = require("../position");
class ReleaseIdocConf extends _basic_rule_config_1.BasicRuleConfig {
}
exports.ReleaseIdocConf = ReleaseIdocConf;
class ReleaseIdoc {
constructor() {
this.conf = new ReleaseIdocConf();
}
getMetadata() {
return {
key: "release_idoc",
title: "Release iDoc",
shortDescription: `Checks idoc types and segments are set to status released`,
};
}
getMessage() {
return "Idoc type/segement status must be set to released";
}
getConfig() {
return this.conf;
}
setConfig(conf) {
this.conf = conf;
}
initialize(_reg) {
return this;
}
run(obj) {
const file = obj.getXMLFile();
if (file === undefined) {
return [];
}
if (obj instanceof Objects.Table) {
if (file.getRaw().includes("<SEGMENTDEFINITION>") === false) {
return [];
}
}
else if (!(obj instanceof Objects.Idoc)) {
return [];
}
if (file.getRaw().includes("<CLOSED>X</CLOSED>") === false) {
const position = new position_1.Position(1, 1);
const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, this.getMessage(), this.getMetadata().key, this.conf.severity);
return [issue];
}
else {
return [];
}
}
}
exports.ReleaseIdoc = ReleaseIdoc;
//# sourceMappingURL=release_idoc.js.map