Fix JSON Schema comment injection in generated code#2870
Open
schani wants to merge 19 commits into
Open
Conversation
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.
Summary
emitCommentLines/emitCommentsso renderers do not need to escape manually.*/), Elm/Haskell (-}), and triple-quoted (""") documentation comments.CI coverage
The PR workflow now includes a dedicated row for:
comment-injection-treesittercomment-injection-typescriptcomment-injection-typescript-zodcomment-injection-typescript-effect-schemaExisting schema fixture rows also pick up the new schema samples for languages that already run
schema-*in CI.Not yet in CI: Objective-C comment-injection fixture, because Objective-C is currently disabled/commented out in the workflow. PHP is covered by the tree-sitter parser fixture, not a runtime fixture.
Validation run locally
npm run buildnpx tsc -p test/tsconfig.json --noEmitCPUs=1 QUICKTEST=true FIXTURE=comment-injection-treesitter npm test -- test/inputs/schema/comment-injection.schemaCPUs=1 QUICKTEST=true FIXTURE=schema-typescript npm test -- test/inputs/schema/comment-injection.schemaCPUs=1 QUICKTEST=true FIXTURE=comment-injection-typescript npm testCPUs=1 QUICKTEST=true FIXTURE=comment-injection-typescript-zod npm testCPUs=1 QUICKTEST=true FIXTURE=comment-injection-typescript-effect-schema npm testCPUs=1 QUICKTEST=true FIXTURE=comment-injection-treesitter,comment-injection-typescript,comment-injection-typescript-zod,comment-injection-typescript-effect-schema npm test