feat(entrypoints): rule-based bulk overrides in entrypoints.toml#21
Merged
tob-scott-a merged 1 commit intomainfrom Apr 23, 2026
Merged
feat(entrypoints): rule-based bulk overrides in entrypoints.toml#21tob-scott-a merged 1 commit intomainfrom
tob-scott-a merged 1 commit intomainfrom
Conversation
The override file previously accepted only single-node entries; tagging every PHP script in public_html/ or every function taking a PSR-7 request required listing each function by id. This adds rule-based entries that match many nodes at once. Three new fields on `[[entrypoint]]` tables (any combination; multiple compose with AND): - `file_glob = "public_html/**/*.php"` — match against CodeUnit.location.file_path with a shell glob supporting `**` (recursive) and `*` (single-segment). - `param_type = "ServerRequestInterface"` — match any function whose parameter list includes a declared type with this name. - `name_regex = "^handle_"` — match function names via regex. Conditions inside an entry compose with AND. Later entries in the file override earlier ones — same precedence rule as before. `_glob_to_regex` translates shell globs into regexes with explicit `**` handling so the feature works on Python 3.12 (which lacks `PurePath.full_match`). Paths are normalized to forward slashes before matching so the same pattern works on Windows. Malformed patterns (bad regex, bad glob) are silently skipped so one broken rule can't disable the whole override file. 8 new tests: file_glob at various depths, single-star scoping, param_type matching, name_regex, AND composition, rule-over-heuristic precedence, malformed glob tolerance, and zero-match non-error. README documents each rule type with examples, including the canonical "mark all PHP scripts in public_html/" and "mark any function taking a PSR-7 request" cases from the design discussion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 override file previously accepted only single-node entries; tagging every PHP script in public_html/ or every function taking a PSR-7 request required listing each function by id. This adds rule-based entries that match many nodes at once.
Three new fields on
[[entrypoint]]tables (any combination; multiple compose with AND):file_glob = "public_html/**/*.php"— match against CodeUnit.location.file_path with a shell glob supporting**(recursive) and*(single-segment).param_type = "ServerRequestInterface"— match any function whose parameter list includes a declared type with this name.name_regex = "^handle_"— match function names via regex.Conditions inside an entry compose with AND. Later entries in the file override earlier ones — same precedence rule as before.
_glob_to_regextranslates shell globs into regexes with explicit**handling so the feature works on Python 3.12 (which lacksPurePath.full_match). Paths are normalized to forward slashes before matching so the same pattern works on Windows.Malformed patterns (bad regex, bad glob) are silently skipped so one broken rule can't disable the whole override file.
8 new tests: file_glob at various depths, single-star scoping, param_type matching, name_regex, AND composition, rule-over-heuristic precedence, malformed glob tolerance, and zero-match non-error.
README documents each rule type with examples, including the canonical "mark all PHP scripts in public_html/" and "mark any function taking a PSR-7 request" cases from the design discussion.