MCPcopy Create free account
hub / github.com/Snapchat/Valdi / printStatus

Function printStatus

npm_modules/cli/src/utils/lintUtils.ts:158–190  ·  view source on GitHub ↗
(lintResults: FileLintStatus[], showSkipped: boolean = false)

Source from the content-addressed store, hash-verified

156}
157
158export function printStatus(lintResults: FileLintStatus[], showSkipped: boolean = false) {
159 let textColor = ANSI_COLORS.RESET_COLOR;
160
161 for (const [shortPath, status] of lintResults) {
162 switch (status) {
163 case RESULT_STATUS.DIRECTORY: {
164 continue;
165 }
166 case RESULT_STATUS.SKIPPED: {
167 if (!showSkipped) {
168 continue;
169 }
170
171 textColor = ANSI_COLORS.GRAY_COLOR;
172 break;
173 }
174 case RESULT_STATUS.VALID: {
175 textColor = ANSI_COLORS.GRAY_COLOR;
176 break;
177 }
178 case RESULT_STATUS.NEEDS_FORMAT: {
179 textColor = ANSI_COLORS.YELLOW_COLOR;
180 break;
181 }
182 case RESULT_STATUS.CHANGED: {
183 textColor = ANSI_COLORS.YELLOW_COLOR;
184 break;
185 }
186 }
187
188 console.log(`${wrapInColor(shortPath, textColor)} - ${status}`);
189 }
190}

Callers 2

lintCheckFunction · 0.90
lintFormatFunction · 0.90

Calls 2

wrapInColorFunction · 0.90
logMethod · 0.65

Tested by

no test coverage detected