id: no-print
language: python
severity: warning
message: Avoid `print()` in production code. Use `logging` instead.
note: |
`print()` calls in production code should use the `logging` module for
proper log level control, formatting, and output routing. Scope this rule
with `ignores` to exclude test directories and scripts where console
output is acceptable. (The `!` negation in `files` is ignored by the pinned
ast-grep version; use `ignores`.)
rule:
kind: call
has:
field: function
pattern: print
files:
- "**/*.py"
ignores:
- "tests/**"
- "**/test_*.py"
- "**/*_test.py"
- "scripts/**"
- "crates/codegen/vtcode-skills/src/skills/assets/samples/**"
- "patches/**"