Repository navigation
Exclude commented-out config items from item descriptions - #1223
Conversation
Commented-out values (ex: `# ITEM=prod-value`) were joined into the next item's description and ended up in generated types. Skip them, including continuation lines of multi-line values.
📦 Bundle size
dist/ only; native binaries are versioned separately and not counted here. |
|
The changes in this PR will be included in the next version bump.
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
varlock-website | 5510130 | Commit Preview URL Branch Preview URL |
Oct 13 2026, 10:41 PM |
There was a problem hiding this comment.
Important
Two valid multiline cases still leak commented-out values into descriptions and generated types.
Reviewed changes: Reviewed the description filter, multiline scanner, parser and type-generation tests, documentation, and release entry.
- Assignment filtering: Excludes commented-out assignments, including optional
exportand extra leading comment prefixes, without changing attachment or round-tripping. - Continuation scanning: Tracks quotes and structured values to omit subsequent value lines from descriptions.
- Regression coverage: Adds parser and generated-type checks; all 276 parser tests and 94 focused type-generation tests pass, but the reproduced cases below are not covered.
gpt-6.1-sol | 𝕏
@env-spec/parser
varlock
@varlock/native-helper-darwin
@varlock/native-helper-linux-arm64
@varlock/native-helper-linux-x64
@varlock/native-helper-win32-x64
commit: |
There was a problem hiding this comment.
Important
The existing internal-comment finding is only partially addressed: a grammar-valid comment immediately after a quoted or nested value can still expose continuation values in descriptions. Added the verified reproduction to the existing thread; no duplicate finding was opened.
Reviewed changes: Reviewed the scanner corrections and regression cases added since 7eb6991.
- Tracked expected closers: Replaced bracket depth with a stack that accounts for interpolation and ignores non-matching scalar delimiters.
- Recognized internal comments: Added comment handling at value starts and after whitespace, fixing the original spaced-comment reproduction but leaving the adjacent-comment case above.
- Added regression cases: Covered interpolation, trailing and full-line internal comments, and non-matching scalar closers. All 276 parser tests passed.
gpt-6.1-sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: Reviewed the scanner fix and regression cases added since fe1bda2.
- Recognized adjacent comments: Added element-end tracking so comments directly after completed quoted values or nested structures cannot prematurely close the surrounding commented-out value.
- Added regression coverage: Covered adjacent comments after quotes and nested arrays. All 276 parser tests passed, and independent reproductions also confirmed the object and function-call variants are fixed.
gpt-6.1-sol | 𝕏
…d of scanning for its end Detect whether a commented-out value is closed on its own line using the real parser, rather than reimplementing the grammar to find where a multi-line value ends. Decorators are unaffected.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: Reviewed the parser-backed description filtering and regression coverage added since c48d5f4.
- Replaced continuation scanning: Used the real parser to identify values not closed on their assignment line, then omitted the remainder of the description block.
- Preserved independent behavior: Kept later descriptions for same-line closed values and retained decorators after unclosed values, with new regression tests.
- Updated documentation: Documented whole-block description truncation and unchanged decorator handling.
All 278 parser tests passed. The parser build and smoke checks against both bundled ESM and CJS entry points also passed.
gpt-6.1-sol | 𝕏



Regular comments attached to an item become its description, which feeds generated types and other tooling. A commented-out value directly above an item, often a real production value, was being included:
Comment lines that look like a commented-out item (
KEY=..., optionalexport, spaces around=, extra leading#s) are now skipped when building the description.If a commented-out value opens a multi-line value that is not closed on the same line (quoted string, literal, or function call), the rest of the comment block is left out of the description. Whether it is closed is checked by running the real parser on that line, rather than reimplementing the grammar to find where the value ends. Unclosed literals fall back to plain strings in the grammar, so "does it parse" alone can't find the end.
Scope is descriptions only. Comment block attachment and decorators are unchanged; blank lines and dividers remain the only block separators.