Skip to content

feat: Ruff T20 (print) lint and test-module reminder hook#29

Merged
buddingengineers12345 merged 1 commit into
mainfrom
feat/ruff-t20-test-reminder-hooks
Apr 8, 2026
Merged

feat: Ruff T20 (print) lint and test-module reminder hook#29
buddingengineers12345 merged 1 commit into
mainfrom
feat/ruff-t20-test-reminder-hooks

Conversation

@buddingengineers12345
Copy link
Copy Markdown
Owner

Summary

  • Ruff T20 (flake8-print) is enabled in template/pyproject.toml.jinja and the meta-repo pyproject.toml, so ruff check (PostToolUse hook, pre-commit, CI) flags print() in application code as T201.
  • Per-file ignores: tests/**, scripts/**, and src/**/bump_version.py may still use print().
  • pre-config-protection blocks adding T20 or T201 to the global ignore list (same spirit as existing D/E/F/I/B guards).
  • pre-write-src-test-reminder.sh (PreToolUse, non-blocking): warns when tests/<pkg>/test_<module>.py is missing for top-level src/<pkg>/<module>.py (excludes __init__.py and nested paths like src/<pkg>/common/... to avoid noise vs shared tests such as test_support.py).
  • Mirrored in root .claude/ per template maintenance practice; docs updated; test_generated_pyproject_ruff_includes_print_rules asserts the rendered pyproject.toml.

Notes

  • Local just ci may fail on just audit in some environments (pip-audit/venv); ruff check, basedpyright, and just test-ci were verified passing.

Made with Cursor

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file template tests labels Apr 8, 2026
- Enable Ruff flake8-print (T20) in generated projects and this repo; allow
  print in tests/, scripts/, and bump_version.py via per-file-ignores.
- Extend pre-config-protection to block silencing T20/T201 in the global
  ruff ignore list.
- Add pre-write-src-test-reminder.sh (PreToolUse): non-blocking warning when
  tests/<pkg>/test_<module>.py is missing for top-level src/<pkg>/<module>.py.
- Register the hook in template and root .claude/settings.json; document in
  hook READMEs and python/hooks.md.
- Add test_generated_pyproject_ruff_includes_print_rules.

Made-with: Cursor
@buddingengineers12345 buddingengineers12345 force-pushed the feat/ruff-t20-test-reminder-hooks branch from 934a3cb to 83cd2e2 Compare April 8, 2026 17:49
@buddingengineers12345 buddingengineers12345 merged commit a1513ce into main Apr 8, 2026
9 checks passed
@buddingengineers12345 buddingengineers12345 deleted the feat/ruff-t20-test-reminder-hooks branch April 8, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation template tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants