Skip to content

style(protos): use /* ... */ for multi-line comments - #8991

Merged
wjones127 merged 1 commit into
lance-format:mainfrom
wjones127:proto-block-comments
Sep 4, 2026
Merged

wjones127 merged 1 commit into
lance-format:mainfrom
wjones127:proto-block-comments

Conversation

@wjones127

Copy link
Copy Markdown
Contributor

Multi-line comments in the .proto files were written as runs of // lines, which editors cannot fold. The long design notes in file2.proto, table.proto and the encoding schemas therefore dominate the files when you are trying to read the schema itself.

This converts every multi-line comment run to a /* text / * text / */ block, and adds a check that keeps it that way. We had no protobuf linting before — buf.yaml exists only to publish the module to the BSR, and buf lint has no rule for comment syntax — so the check is a small script, ci/check_proto_comments.py, wired up as a pre-commit hook (which auto-fixes) and a new Protobuf lint workflow.

No schema field, name or number changes, and no generated code changes: the /* text / * text layout keeps each content column exactly where the // form had it, so protoc extracts byte-identical leading comments. I verified this by diffing the --include_source_info descriptors for every proto before and after. The only differences are two incidental improvements: /// runs no longer leave a stray / at the start of each generated doc line, and two stray trailing spaces are gone.

Not included

Single-line // comments are untouched, as are the SPDX headers (license-header-check requires those verbatim). Adding buf lint or buf breaking to CI would be a separate PR.

Multi-line comments in the .proto files were written as runs of `//` lines,
which editors cannot fold. The long design notes in `file2.proto`,
`table.proto` and the encoding schemas therefore dominate the files when you
are trying to read the schema itself.

This converts every multi-line comment run to a `/* text` / ` * text` / ` */`
block and adds `ci/check_proto_comments.py` to enforce the style, wired up as
a pre-commit hook (with `--fix`) and a new `Protobuf lint` workflow.

The layout keeps each content column where the `//` form had it, so protoc
extracts identical leading comments and the generated Rust, Python and Java
doc comments are unchanged. The only differences are that `///` runs no longer
leave a stray `/` at the start of each generated doc line, and two stray
trailing spaces are gone.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer A-format On-disk format: protos and format spec docs A-ci CI / build workflows format-change A change to the format spec, which requires a vote. Remove if minor (e.g. fixing typo). chore labels Sep 4, 2026
@wjones127 wjones127 removed the A-format On-disk format: protos and format spec docs label Sep 4, 2026
@wjones127
wjones127 marked this pull request as ready for review September 4, 2026 16:50
@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Format specification vote

This PR modifies the Lance format specification, so it requires 3 binding +1 votes from PMC members (excluding the proposer) and a minimum 72-hour voting period, weekends excluded, before it can merge. Vote by approving this PR (+1) or requesting changes (−1, a veto). See the voting process.

Status: ❌ Blocked — 1 of 3 required approvals

Approvals (this commit) @jackye1995 (1/3)
Vetoes none
Voting period ends Wed 2026-09-09 16:50 UTC (09:50 PDT)

Updated automatically by the format-spec vote gate, which re-checks every 15 minutes — just voted? Re-check now (press Run workflow; leave the input blank to re-check every open format PR). A PMC member may apply the format-waived label to waive the vote for a trivial edit (typo, wording, formatting).

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

The conversion improves schema readability while preserving the protobuf wire and file-format contract. Repository-local enforcement is preferable to editor-specific folding settings because it keeps the convention consistent for every contributor.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 4, 2026
@wjones127 wjones127 removed the format-change A change to the format spec, which requires a vote. Remove if minor (e.g. fixing typo). label Sep 4, 2026
@wjones127
wjones127 merged commit 4157766 into lance-format:main Sep 4, 2026
40 of 42 checks passed
wjones127 added a commit that referenced this pull request Sep 8, 2026
The multi-line comment style landed with its own pre-commit hook (#8991)
while this draft was out for review, and these files predate it. No wording
changes; the hook did the rewrite.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
wjones127 added a commit that referenced this pull request Oct 26, 2026
The multi-line comment style landed with its own pre-commit hook (#8991)
while this draft was out for review, and these files predate it. No wording
changes; the hook did the rewrite.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
geruh pushed a commit to geruh/lance that referenced this pull request Nov 4, 2026
The multi-line comment style landed with its own pre-commit hook (lance-format#8991)
while this draft was out for review, and these files predate it. No wording
changes; the hook did the rewrite.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ci CI / build workflows A-index Vector index, linalg, tokenizer chore K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants