fix: harden pnpm-workspace.yaml parsing for inline comments#53
Merged
thefourcraft merged 2 commits intoproductionfrom May 4, 2026
Merged
fix: harden pnpm-workspace.yaml parsing for inline comments#53thefourcraft merged 2 commits intoproductionfrom
thefourcraft merged 2 commits intoproductionfrom
Conversation
- strip_yaml_inline_comment helper strips unquoted # comments while preserving # inside single or double quotes - packages: key is recognised with trailing inline comments - Blank lines and pure-comment top-level lines no longer end the packages section; only a real top-level key does - List item patterns with inline comments are stripped before the value is extracted; quoted # characters in patterns are safe
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
strip_yaml_inline_commenthelper strips unquoted#comments while preserving#characters inside single or double quotespackages: # commentis now recognised as the section key (was silently ignored before)packagessection — only a real key does- "packages/*" # all packagesare stripped topackages/*before processing;#inside quotes is left intactTest plan
pnpm_packages_key_with_inline_comment_is_recognized—packages: # comment+- "packages/*" # commentdetects memberpnpm_top_level_comment_between_key_and_items_does_not_end_section— top-level# commentline between key and items doesn't end sectionpnpm_other_section_with_inline_comment_still_excluded—ignoredBuiltDependencies: # commentstill excluded from memberspnpm_quoted_hash_in_pattern_not_truncated—#inside quotes not treated as comment marker (unit test on helper)cargo clippy --bin barzel -- -D warningscleangit diff --check production..HEADclean