Repository navigation
feat: validate_on_decode, and generated validators end to end - #71
Merged
Merged
Conversation
comline.toml's [generate] / [[generate.target]] validate_on_decode (off | collect | first), with COMLINE_GENERATE_VALIDATE_ON_DECODE and --validate-on-decode, resolved like external_std and handed to the generator. An unknown value names the accepted ones. comline new's template lists it. Pins core 8243d98, codegen 16b94d4, comline-rust d0c5013, comline-typescript 9f2b7ec. A second end-to-end test generates a package using std's StringBounds through a type alias and runs it: validate() reports paths and messages, and with collect a call whose argument fails is refused while the connection survives. copy_fixture now carries a fixture's comline.toml.
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.
Step 4c of core#96, plus the cli's part of #99.
comline.tomlgainsvalidate_on_decode = "off" | "collect" | "first"in[generate]and per[[generate.target]].COMLINE_GENERATE_VALIDATE_ON_DECODEand--validate-on-decode, with the same precedence asexternal_std(flag → env → target → section →off).comline new's template lists it.generated_validators_run_end_to_endruns the realcomline generateon a package that uses std'sStringBoundsthrough atypealias, then tests the generated crate:validate()returns each failure's path and message (friends[1] must be at least 2 characters);collect, the provider refuses a call whose argument fails its checks, and the connection survives.copy_fixturenow copies a fixture'scomline.toml; it silently dropped it before.Tests, clippy (
-D warnings) and fmt all pass.