Skip to content

feat(hooks): add pre-commit hook for print()/console.* detection - #1093

Merged
mrveiss merged 1 commit into
Dev_new_guifrom
fix/1082-precommit-print-console
Feb 21, 2026
Merged

mrveiss merged 1 commit into
Dev_new_guifrom
fix/1082-precommit-print-console

Conversation

@mrveiss

@mrveiss mrveiss commented Feb 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • New pre-commit hook script pre-commit-no-print-console that blocks commits containing print() in Python or console.* in TypeScript/Vue production code
  • Added hook entry to .pre-commit-config.yaml
  • Smart exclusions: test files, debugUtils.ts, RumConsoleHelper.ts, infrastructure/, config files
  • Supports # noqa: print and // noqa: console exemptions
  • Regex avoids false positives on fingerprint(), pretty_print(), blueprint.print(), etc.

Test Plan

  • Hook correctly catches print() calls in Python
  • Hook correctly catches console.log/warn/error/debug/info in TypeScript
  • No false positives on fingerprint(), pretty_print(), sprint(), etc.
  • Test files, debugUtils.ts, and RumConsoleHelper.ts are excluded
  • # noqa: print and // noqa: console exemptions work
  • Hook passes pre-commit validation

Closes #1082

🤖 Generated with Claude Code

New hook blocks commits containing print() in Python or console.*
in TypeScript/Vue production code. Excludes test files, debugUtils.ts,
RumConsoleHelper.ts, and infrastructure/. Supports noqa exemptions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mrveiss
mrveiss merged commit 3fab62a into Dev_new_gui Feb 21, 2026
0 of 2 checks passed
@mrveiss
mrveiss deleted the fix/1082-precommit-print-console branch February 21, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant