()
| 233 | |
| 234 | // Main check function |
| 235 | async function runChecks() { |
| 236 | console.log('🔍 Running Code Quality Check v2...\n'); |
| 237 | |
| 238 | const { files, mode, base } = await getFilesToCheck(); |
| 239 | |
| 240 | let modeDescription = mode; |
| 241 | if (mode === 'base-comparison') { |
| 242 | modeDescription = `comparing against ${base}`; |
| 243 | } else if (mode === 'since-last-commit') { |
| 244 | modeDescription = 'files changed since last commit'; |
| 245 | } else if (mode === 'staged-fallback') { |
| 246 | modeDescription = 'staged files (no previous commit found)'; |
| 247 | } |
| 248 | |
| 249 | console.log(`📝 Check mode: ${modeDescription}`); |
| 250 | if (files.length > 0 && mode !== 'full') { |
| 251 | console.log(`📁 Files to check: ${files.length}`); |
| 252 | } |
| 253 | console.log(); |
| 254 | |
| 255 | const results = { |
| 256 | mode: modeDescription, |
| 257 | files: files.length, |
| 258 | biome: { success: false as any }, |
| 259 | typescript: { success: false as any }, |
| 260 | overall: false |
| 261 | }; |
| 262 | |
| 263 | const shouldRunBiome = !values.only || values.only === 'biome'; |
| 264 | const shouldRunTypeScript = (!values.only || values.only === 'typescript') && !values['no-ts']; |
| 265 | |
| 266 | // Run checks in parallel when possible |
| 267 | const promises: Promise<void>[] = []; |
| 268 | |
| 269 | // Biome check |
| 270 | if (shouldRunBiome) { |
| 271 | promises.push((async () => { |
| 272 | let biomeCmd: string[]; |
| 273 | |
| 274 | if (mode === 'full') { |
| 275 | biomeCmd = ['bun', 'x', 'biome', 'check', '--write', '.']; |
| 276 | } else { |
| 277 | const biomeFiles = filterFilesForTool(files, 'biome'); |
| 278 | if (biomeFiles.length > 0) { |
| 279 | biomeCmd = ['bun', 'x', 'biome', 'check', '--write', ...biomeFiles]; |
| 280 | } else { |
| 281 | console.log('🧹 Biome Check: No relevant files to check.'); |
| 282 | results.biome = { success: true, stdout: '', stderr: '', exitCode: 0 }; |
| 283 | return; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | results.biome = await runCommand(biomeCmd, '🧹 Biome Check:'); |
| 288 | })()); |
| 289 | } else { |
| 290 | results.biome = { success: true, stdout: 'Skipped', stderr: '', exitCode: 0 }; |
| 291 | } |
| 292 |
no test coverage detected
searching dependent graphs…