(lintResults: FileLintStatus[], showSkipped: boolean = false)
| 156 | } |
| 157 | |
| 158 | export 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 | } |
no test coverage detected