@quenty/cli-output-helpers
Version:
Helpers to generate Nevermore package and game templates
44 lines • 1.68 kB
TypeScript
/**
* GitHub Actions workflow annotation helpers.
*
* Emits `::error` / `::warning` / `::notice` workflow commands to stdout,
* which GitHub renders as inline annotations on the PR diff.
*
* Also provides helpers to write a markdown summary to `$GITHUB_STEP_SUMMARY`.
*/
export type DiagnosticSeverity = 'error' | 'warning' | 'notice';
export interface Diagnostic {
file: string;
line: number;
endLine?: number;
column?: number;
endColumn?: number;
severity: DiagnosticSeverity;
message: string;
title?: string;
source?: string;
}
export interface DiagnosticSummary {
errors: number;
warnings: number;
notices: number;
total: number;
fileCount: number;
}
/** Format a single diagnostic as a GitHub Actions workflow command. */
export declare function formatAnnotation(diagnostic: Diagnostic): string;
/**
* Emit workflow annotation commands for each diagnostic to stdout.
* GitHub Actions parses these from stdout and creates inline annotations.
*/
export declare function emitAnnotations(diagnostics: Diagnostic[]): void;
/** Count diagnostics by severity and unique files. */
export declare function summarizeDiagnostics(diagnostics: Diagnostic[]): DiagnosticSummary;
/** Format a markdown summary suitable for `$GITHUB_STEP_SUMMARY`. */
export declare function formatAnnotationSummaryMarkdown(linterName: string, diagnostics: Diagnostic[]): string;
/**
* Append a lint summary to `$GITHUB_STEP_SUMMARY`.
* No-ops gracefully outside of GitHub Actions.
*/
export declare function writeAnnotationSummaryAsync(linterName: string, diagnostics: Diagnostic[]): Promise<void>;
//# sourceMappingURL=annotations.d.ts.map