chore: update pre-commit hooks to remove staged file references and clean up logger output

This commit is contained in:
icld
2025-02-27 10:52:05 -08:00
parent b0de546668
commit 7809fa765e
3 changed files with 7 additions and 32 deletions
+2 -2
View File
@@ -3,11 +3,11 @@ pre-commit:
commands:
lint:
glob: "*.{js,ts,jsx,tsx}"
run: pnpm lint:fix {staged_files}
run: pnpm lint:fix
stage_fixed: true
format:
glob: "*.{js,ts,jsx,tsx}"
run: pnpm format:fix {staged_files}
run: pnpm format:fix
stage_fixed: true
typecheck:
glob: "*.{ts,tsx}"
-14
View File
@@ -1,14 +0,0 @@
pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
# run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
run: pnpm biome format --write {staged_files}
stage_fixed: true
pre-push:
parallel: true
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {push_files}
+5 -16
View File
@@ -23,20 +23,13 @@ const formatCommand = (cmd) => {
// Display a header for the command
console.log(
'\n' +
chalk.gray(
'╔═════════════════════════════════════════════════════════════════════════════╗'
)
`\n${chalk.gray('╔═════════════════════════════════════════════════════════════════════════════╗')}`
)
console.log(
chalk.gray('║ ') +
chalk.white.bold(`LEFTHOOK: ${formatCommand(command)}`) +
chalk.gray(' ║')
`${chalk.gray('║ ')}${chalk.white.bold(`LEFTHOOK: ${formatCommand(command)}`)}${chalk.gray(' ║')}`
)
console.log(
chalk.gray(
'╚═════════════════════════════════════════════════════════════════════════════╝\n'
)
`${chalk.gray('╚═════════════════════════════════════════════════════════════════════════════╝\n')}`
)
// If we have files, display them
@@ -66,16 +59,12 @@ try {
// Show success message
console.log(
'\n' +
chalk.green.bold('✓ SUCCESS') +
chalk.green(` ${formatCommand(command)} completed successfully`)
`\n${chalk.green.bold('✓ SUCCESS')}${chalk.green(` ${formatCommand(command)} completed successfully`)}`
)
} catch (error) {
// Show error message
console.log(
'\n' +
chalk.red.bold('✗ ERROR') +
chalk.red(` ${formatCommand(command)} failed`)
`\n${chalk.red.bold('✗ ERROR')}${chalk.red(` ${formatCommand(command)} failed`)}`
)
process.exit(1)
}