hooks: include private functions in export-functions.py by default; add --skip-private flag#1842
Merged
Merged
Conversation
… by default Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
…mitted Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hooks export-functions.py to include private functions in docs
hooks: include private functions in export-functions.py by default; add --skip-private flag
Apr 7, 2026
nathanjmcdougall
approved these changes
Apr 7, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Private helpers with docstrings were invisible to agents because
export-functions.pyunconditionally skipped any function starting with_. This meant reusable utilities like_get_current_python_version()were absent fromdocs/functions.txtand therefore from the Function Reference inAGENTS.md.Changes
hooks/export-functions.py: Adds--skip-privateflag (default: off). Without the flag, all functions with docstrings — public and private — are exported.--strictonly enforces docstrings on public functions; private functions without docstrings are silently omitted.docs/functions.txt: Regenerated — ~37 additional private helpers now included.AGENTS.md: Sync block updated with the new entries.src/usethis/_file/yaml/update.py: Fixed__eq__→`__eq__`in docstring to prevent a prettier ↔ fix-doc-sync formatting cycle.tests/hooks/test_export_functions.py: 20 new tests covering the public/private inclusion logic,--skip-private,--strictbehaviour, and edge cases.Example