MCPcopy Index your code
hub / github.com/codeaashu/claude-code / formatWarnings

Function formatWarnings

src/keybindings/validate.ts:470–498  ·  view source on GitHub ↗
(warnings: KeybindingWarning[])

Source from the content-addressed store, hash-verified

468 * Format multiple warnings for display.
469 */
470export function formatWarnings(warnings: KeybindingWarning[]): string {
471 if (warnings.length === 0) return ''
472
473 const errors = warnings.filter(w => w.severity === 'error')
474 const warns = warnings.filter(w => w.severity === 'warning')
475
476 const lines: string[] = []
477
478 if (errors.length > 0) {
479 lines.push(
480 `Found ${errors.length} keybinding ${plural(errors.length, 'error')}:`,
481 )
482 for (const e of errors) {
483 lines.push(formatWarning(e))
484 }
485 }
486
487 if (warns.length > 0) {
488 if (lines.length > 0) lines.push('')
489 lines.push(
490 `Found ${warns.length} keybinding ${plural(warns.length, 'warning')}:`,
491 )
492 for (const w of warns) {
493 lines.push(formatWarning(w))
494 }
495 }
496
497 return lines.join('\n')
498}
499

Callers

nothing calls this directly

Calls 3

pluralFunction · 0.85
formatWarningFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected