Fix capitalize-comments hook entry point, add AGENTS.md - #30
Conversation
|
👋 Hello @glenn-jocher, thank you for submitting a
For more guidance, please refer to our Contributing Guide. This is an automated message, and an engineer will assist with any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Clean PR. The console-script entry point, hook configuration, and main() refactor are consistent, and the accompanying documentation accurately describes the required packaging flow.
|
🎉 Thank you and congratulations on the successful merge, @glenn-jocher!
This PR turns that spirit into practical improvements: a reliable |
The
capitalize-commentshook did not run for any consumer. Reproduced against a scratch repository before and after the fix.Before:
After:
(the second result is the expected outcome for a formatting hook that rewrote a file — the comments were correctly capitalized)
Cause:
language: pythonresolvesentryas a command on PATH inside the environment pre-commit builds, butpyproject.tomldeclared no[project.scripts], so nothing namedcapitalize_comments.pywas ever installed.Changes:
capitalize_comments.py: move the__main__body into amain()entry point and hoist thesysimport.pyproject.toml: declare thecapitalize-commentsconsole script..pre-commit-hooks.yaml: pointentryat that console script. The hookidis unchanged, so existing.pre-commit-config.yamlfiles keep working untouched.README.md: the "Adding New Hooks" instructions and example still described the filename-as-entry pattern that does not work — updated to the console-script pattern.AGENTS.mdwith the standard Ultralytics Core Principles and PR Workflow, plus repo-specific Commands, Architecture, and Conventions.CLAUDE.mdis a symlink to it.🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
🔧 Fixes the
capitalize-commentspre-commit hook entry point and improves repository guidance for contributors and AI coding agents.📊 Key Changes
capitalize-commentsas a console script inpyproject.toml..pre-commit-hooks.yamlto invoke the console command instead of the Python filename.capitalize_comments.pyto expose a reusablemain()function.AGENTS.mdwith repository architecture, contribution workflow, validation steps, and coding principles.CLAUDE.mdas a symlink toAGENTS.md.🎯 Purpose & Impact
language: pythonpre-commit environments, preventing runtime “executable not found” failures.