Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function main(): Promise<void> {
const logErrorFilePath = argv.logError as string | undefined;
const logDiagnosticFilePath = argv.logDiagnostic as string | undefined;
const strict = argv.strict as boolean ?? false;

let logDexFilePath;
// Schemevalidation and Spectral Document creation ----------
let apiSpecDocument: SpectralDocument;
let parseResult: ParseResult;
Expand Down Expand Up @@ -196,6 +196,7 @@ async function main(): Promise<void> {
outputFilePath: argv.dex,
});
reportHandler.generateReportDocument(customDiagnostic);
logDexFilePath = reportHandler.diagnosticInformation.outputFilePath;
} catch (dexError: any) {
logErrorToFile(dexError);
console.error(chalk.red('Misslyckades att skriva till excelfilen!'));
Expand Down Expand Up @@ -332,6 +333,10 @@ async function main(): Promise<void> {
result.forEach((item) => console.log(formatLintingResult(item)));
}
}
if (logDexFilePath!=undefined) {
console.log(chalk.green(`Skriver diagnostiseringsinformation i excelformat från RAP-LP till ${logDexFilePath}`));

}
} catch (spectralError: any) {
logErrorToFile(spectralError); // Log stack
console.error(
Expand Down
4 changes: 4 additions & 0 deletions src/util/excelReportProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class ExcelReportProcessor {
private parser = new XMLParser({ ignoreAttributes: false });
private builder = new XMLBuilder({ ignoreAttributes: false });
private zip: AdmZip;

constructor(config?: Partial<ExcelTemplateConfig>) {
const isPresent = (x?: string): x is string => {
return x != null && x !== '';
Expand All @@ -88,6 +89,9 @@ export class ExcelReportProcessor {

this.zip = new AdmZip(this.config.reportTemplatePath);
}
public get diagnosticInformation(): ExcelTemplateConfig {
return this.config;
}

public generateReportDocument(result: RapLPDiagnostic) {
// Convert the result Raport to map with Rule name as key and status as value.
Expand Down
Loading