Repository navigation
Bug: Pre-commit hooks not blocking print()/console.* violations #1082
Copy link
Copy link
Closed
Labels
Description
Activity
- added a commit that references this issue
on Feb 21, 2026 ✅ Implemented in PR #1093
Changes:
- Created
autobot-infrastructure/shared/scripts/hooks/pre-commit-no-print-console— bash hook script that scans staged Python files forprint()and staged TypeScript/Vue files forconsole.*calls - Added hook entry to
.pre-commit-config.yamlasno-print-consolelocal hook - Smart exclusions: test files, debugUtils.ts, RumConsoleHelper.ts, infrastructure/, config files, .d.ts
- Supports
# noqa: printand// noqa: consoleinline exemptions - Regex avoids false positives (
fingerprint(),pretty_print(),blueprint.print(), etc.)
Verification:
- ✅ Tests passing (hook catches violations correctly)
- ✅ False positive prevention verified
- ✅ All pre-commit hooks pass
- ✅ Ready for review
- Created
- added 4 commits that reference this issue
on Sep 6, 2026 - added 5 commits that reference this issue
on Sep 20, 2026 - added 5 commits that reference this issue
on Oct 7, 2026
Problem
The compliance audit found 685+ logging violations (
print()in Python,console.*in TypeScript) across the codebase. The pre-commit hooks are supposed to block these but are clearly not enforcing the rule effectively.Evidence
print()calls in production Python codeprint()calls in monitoring/script Python codeprint()calls in test filesconsole.*calls in TypeScript/Vue filesDiscovered During
Compliance audit of core development rules (Feb 21, 2026)
Root Cause
Either:
Impact
High — Without enforcement, new violations accumulate with every commit. This is the root cause enabler for all logging violations.
Acceptance Criteria
.pre-commit-config.yamlhas print/console.* checksprint()orconsole.log()is rejecteddebugUtils.ts)