MCPcopy
hub / github.com/prisma/prisma / getLintWarningsAsText

Function getLintWarningsAsText

packages/internals/src/engine-commands/lintSchema.ts:64–76  ·  view source on GitHub ↗
(lintDiagnostics: LintDiagnostic[])

Source from the content-addressed store, hash-verified

62 * |
63 */
64export function getLintWarningsAsText(lintDiagnostics: LintDiagnostic[]): string {
65 const lintWarnings = getLintWarnings(lintDiagnostics)
66
67 const textLines: string[] = []
68 if (lintWarnings.length > 0) {
69 textLines.push(yellow(`\nPrisma schema warning${lintWarnings.length > 1 ? 's' : ''}:`))
70 for (const warning of lintWarnings) {
71 textLines.push(warningToString(warning))
72 }
73 }
74
75 return textLines.join('\n')
76}
77
78export function warningToString(warning: LintDiagnostic): string {
79 return yellow(`- ${warning.text}`)

Callers 2

formatSchemaFunction · 0.90
parseMethod · 0.90

Calls 3

getLintWarningsFunction · 0.85
warningToStringFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected