Repository navigation
feat: typed section names and doctor no-config-file handling - #3
Merged
Merged
Conversation
defineSection and withSections now refuse a literal name that the runtime pattern would reject, with a message that quotes the name and the rule. The type is derived from the same two character-set constants that build the runtime pattern, so it accepts exactly the names the runtime accepts. A name that is not a literal is still left to the existing check, and so is a literal too long for TypeScript to walk.
The doctor result now carries a discriminated outcome field, so a directory with no exadev config file, or an empty one, is no longer indistinguishable from a checked config with nothing unowned. The command prints that no config file was found and nothing was checked, and still exits 0 by default. --require-config turns the no-file case into the existing failure exit code.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Closes the two items left open after the first PR.
A literal section name that the runtime pattern rejects ('1 bad name', 'Foo Bar', '_a', '') is now a compile error at defineSection and withSections, and the message quotes the name and the rule. The type is a recursive template-literal check built from the same two character-set constants that build the runtime regex, so it accepts exactly the names the runtime accepts. Non-literal names still go through the existing check, and a literal longer than TypeScript's 1000-step tail-recursion limit fails to compile as excessively deep. Type-level tests use the existing compiler-API fixtures, plain and with isolatedDeclarations; instantiation count is about 2% up for the whole project.
doctor's result gets an additive outcome field ('checked', 'empty' or 'no-config-file'), typed as a discriminated union so file is a string only when checked. The CLI now says no exadev config file was found and nothing was checked, and still exits 0. The new --require-config flag exits 2 in that case. An empty file exits 0 either way, with its own message. The README has the exit-code table and the doctor docs.
Mutation testing was not run.