Skip to content

fix: harden pnpm-workspace.yaml parsing for inline comments#53

Merged
thefourcraft merged 2 commits intoproductionfrom
feature/pnpm-workspace-inline-comments
May 4, 2026
Merged

fix: harden pnpm-workspace.yaml parsing for inline comments#53
thefourcraft merged 2 commits intoproductionfrom
feature/pnpm-workspace-inline-comments

Conversation

@thefourcraft
Copy link
Copy Markdown
Member

Summary

  • New strip_yaml_inline_comment helper strips unquoted # comments while preserving # characters inside single or double quotes
  • packages: # comment is now recognised as the section key (was silently ignored before)
  • Blank lines and pure-comment lines at the top level no longer terminate the packages section — only a real key does
  • List item patterns like - "packages/*" # all packages are stripped to packages/* before processing; # inside quotes is left intact

Test plan

  • pnpm_packages_key_with_inline_comment_is_recognizedpackages: # comment + - "packages/*" # comment detects member
  • pnpm_top_level_comment_between_key_and_items_does_not_end_section — top-level # comment line between key and items doesn't end section
  • pnpm_other_section_with_inline_comment_still_excludedignoredBuiltDependencies: # comment still excluded from members
  • pnpm_quoted_hash_in_pattern_not_truncated# inside quotes not treated as comment marker (unit test on helper)
  • All 740 tests pass
  • cargo clippy --bin barzel -- -D warnings clean
  • git diff --check production..HEAD clean

- 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
@thefourcraft thefourcraft merged commit e4d095f into production May 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant