Auto-scan source root in export-functions hook instead of hard-coding module paths#1633
Closed
Auto-scan source root in export-functions hook instead of hard-coding module paths#1633
Conversation
…reference Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Add concise one-line docstrings in imperative mood to 37 public functions across 8 files in src/usethis/_core/ that were missing them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Add concise one-line docstrings in imperative mood to 13 public functions across 6 files: - pre_commit/core.py: remove_pre_commit_config() - pre_commit/hooks.py: insert_repo(), add_placeholder_hook(), get_hook_ids(), extract_hook_ids() - pytest/core.py: add_pytest_dir(), remove_pytest_dir() - readme/path.py: get_readme_path(), get_markdown_readme_path() - _pipeweld/containers.py: parallel(), series(), depgroup() - _pipeweld/func.py: get_endpoint() Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Add concise one-line docstrings in imperative mood to 39 public functions across 19 files that were missing them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
…from --source-root with --strict mode - Rewrite hooks/export-functions.py to recursively scan all .py files under --source-root instead of accepting positional source file arguments - Add --strict flag that fails if any public function is missing a docstring - Add AUTO_EXCLUDED set for files like _version.py - Update .pre-commit-config.yaml to use --source-root=src/usethis --strict (no hard-coded file paths) - Add docstrings to 112 public functions across the codebase to comply with --strict - Regenerate docs/functions.txt with comprehensive function reference (191 entries) - Update AGENTS.md sync block with new functions.txt content Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/7de1d7f1-5f63-4ecc-87a7-1f34787c4b92 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix agent config to avoid hard-coding module names
Auto-scan source root in export-functions hook instead of hard-coding module paths
Mar 29, 2026
Collaborator
|
This was also premature. |
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.
The
export-functionshook listed specific module files as positional args in.pre-commit-config.yaml, coupling the config to the project's internal module structure. This rots as modules are added/removed.Hook changes (
hooks/export-functions.py)source_filesargument; now recursively discovers all.pyfiles under--source-root--strictflag — fails if any public function lacks a docstringAUTO_EXCLUDEDset (e.g._version.py) consistent withexport-module-tree.pyast.iter_child_nodes()instead ofast.walk()Config change (
.pre-commit-config.yaml)Before (18 lines, hard-coded paths):
After:
Docstrings
--strictdocs/functions.txtregenerated: 26 → 191 entriesAGENTS.mdsync block updated accordingly✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.