Skip to content

feat: typed section names and doctor no-config-file handling - #3

Merged
Mearman merged 2 commits into
mainfrom
feat/section-name-types-and-doctor-no-file
Sep 29, 2026
Merged

Mearman merged 2 commits into
mainfrom
feat/section-name-types-and-doctor-no-file

Conversation

@Mearman

@Mearman Mearman commented Sep 29, 2026

Copy link
Copy Markdown
Member

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.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-29T23:45:43.019495Z 3026d2a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit f7f1e66 into main Sep 29, 2026
12 checks passed
@Mearman
Mearman deleted the feat/section-name-types-and-doctor-no-file branch September 29, 2026 23:51
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant