Skip to content

config: validate_on_decode defaults to collect; off is { off = "reason" } - #116

Merged
Kinflou merged 3 commits into
masterfrom
feat/validate-on-decode-default
Nov 3, 2026
Merged

Kinflou merged 3 commits into
masterfrom
feat/validate-on-decode-default

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 3, 2026

Copy link
Copy Markdown
Member

Bounds step 10 (ComlineProject/core#98, ComlineProject/core#197): validators are enforced by default, and turning them off is a give-up that carries its reason.

  • ValidateOnDecode's default is now Collect. That covers #[default], the resolver's fallback, and a GenerateRequest built with Default::default().
  • In comline.toml, validate_on_decode is "collect", "first", or { off = "why" } (new ValidateOnDecodeSetting). A bare "off" is refused with the fix ("write validate_on_decode = { off = \"why\" } in comline.toml"), and so is an empty reason. There's no deprecation period (early days). --validate-on-decode and COMLINE_GENERATE_VALIDATE_ON_DECODE take collect or first. A reason is written in comline.toml, so off from either is refused, naming the flag or variable.
  • ResolvedTarget::validate_on_decode_off holds the reason, for the CLI to show the give-up.
  • The generator protocol is unchanged: GenerateRequest.validate_on_decode is still off / collect / first.
  • schemas/comline-toml.json is regenerated (oneOf: a mode, or { off } with a non-empty reason, default collect), and the schema test covers the new rejects.
  • Conformance moves to the generators' branch tips that pin this rev: validators: count a bounded string's length in characters comline-rust#104 (2d50fbf) and deps: generation with validate_on_decode defaulting to collect comline-typescript#127 (ea9b9e2). The conformance fixtures set validate_on_decode explicitly, so no golden moves.

The generators and the CLI pin c303722 (this PR's first commit). Merge order: this, comline-rust#104, comline-typescript#127, then ComlineProject/cli#130.

@Kinflou

Kinflou commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Conformance golden: the only drift is external_std/rust/Cargo.toml's comline_std rev, which follows comline-rust's STD_REV (moved in comline-rust#103, step 8). No validator golden moved: the conformance fixtures set validate_on_decode explicitly.

@Kinflou
Kinflou merged commit 961571b into master Nov 3, 2026
4 checks passed
@Kinflou
Kinflou deleted the feat/validate-on-decode-default branch November 3, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant