diff --git a/github-action/index.ts b/github-action/index.ts index f331d4a..7a3dfdb 100644 --- a/github-action/index.ts +++ b/github-action/index.ts @@ -36,20 +36,17 @@ async function run() { for (const result of results) { for (const error of result.error) { const { diag, hover } = error; - const hoverMessage = (hover && MarkupContent.is(hover.contents)) ? `\n\n${marked(hover.contents.value)}` : '' + const hoverMessage = + hover && MarkupContent.is(hover.contents) ? `\n\n${marked(hover.contents.value)}` : ''; - - core.error( - diag.message + hoverMessage, - { - title: `${diag.message}${diag.source ? ' ' + diag.source + '.' : ''}`, - file: result.filePath, - startLine: diag.range.start.line + 1, - endLine: diag.range.end.line + 1, - startColumn: diag.range.start.character, - endColumn: diag.range.end.character, - }, - ); + core.error(diag.message + hoverMessage, { + title: `${diag.message}${diag.source ? ' ' + diag.source + '.' : ''}`, + file: result.filePath, + startLine: diag.range.start.line + 1, + endLine: diag.range.end.line + 1, + startColumn: diag.range.start.character, + endColumn: diag.range.end.character, + }); } } diff --git a/src/lib.ts b/src/lib.ts index bd899f0..b323a5e 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -60,7 +60,7 @@ interface FileValidationResult { error: { diag: Diagnostic; hover: Hover | null; - }[] + }[]; } /** @@ -122,7 +122,7 @@ export async function getValidationResults(files: string[], settings?: Settings) disableAdditionalProperties: false, customTags: [], }); - const yamlHover = new YAMLHover(schemaService, telemetry) + const yamlHover = new YAMLHover(schemaService, telemetry); return await Promise.all( files.map(async (relativePath: string) => { @@ -135,8 +135,8 @@ export async function getValidationResults(files: string[], settings?: Settings) filePath, error: diagnostics.map((diagnostics, index) => ({ diag: diagnostics, - hover: hovers[index] - })) + hover: hovers[index], + })), }; }), ).then((rs) => rs.filter((r) => r.error.length > 0)); @@ -163,7 +163,9 @@ async function validateAndOutput(files: string[], settings: Settings) { const { diag, hover } = error; const sourceMessage = diag.source ? ` ${diag.source}` : ''; console.error( - `${result.filePath}:${diag.range.start.line + 1}:${diag.range.start.character + 1}: ${diag.message}${sourceMessage}`, + `${result.filePath}:${diag.range.start.line + 1}:${diag.range.start.character + 1}: ${ + diag.message + }${sourceMessage}`, ); } }