HyukjinKwon opened a new pull request, #617:
URL: https://github.com/apache/spark-connect-rust/pull/617
### What changes were proposed in this pull request?
A follow-up of the post-merge review of #602. The doc snippet checker
(`scripts/check_doc_snippets.py`):
- Scans `README.md`, the GitHub and PyPI front page, as well as
`docs/**/*.md`, and compiles its Quickstart.
- Fails, instead of silently skipping, a fence whose info string starts with
`rust` (or `{.rust`) but is neither plain `rust` nor `{.rust .no-run}`.
- Skips a fence directly after a `<!-- snippet: no-run -->` line. GitHub and
PyPI don't render that comment, so the block keeps its Rust highlighting.
- Reports each failure as `<md file>:<line of the fence>: <message>`.
Before, it named only the file, and the rustc line numbers pointed at a deleted
temporary harness.
- Parses fences line by line: backtick and tilde fences at any indent, with
`\r\n` normalized. It counts every fence line and fails on one that it does not
parse as a block, such as one in a blockquote or nested in a longer fence, and
on an unclosed fence, instead of swallowing the next fence.
Two doc changes: `docs/streaming.md`'s `rust,ignore` fence becomes `{.rust
.no-run}`, and the README's `spark_wasm_udf` example gets the no-run marker
plus the imports and `fn main` wrapper of `docs/udfs.md`. That example needs
the macro's build step, so it can't compile in the harness.
### Why are the changes needed?
The review found three problems: a `rust,ignore` fence that was skipped
without a message, a README that was never checked (its UDF example lacked
imports), and failure messages without a markdown location.
### Does this PR introduce _any_ user-facing change?
No. It changes the documentation check and two examples' fences.
### How was this patch tested?
- `python3 -m unittest discover -s scripts/tests`: 50 tests pass. 14 of them
are new: the parser, the refusal, the count guard, the no-run marker, scanning
README.md, and the report format.
- `python3 scripts/check_doc_snippets.py` on a debug build: "Checked 60 rust
snippet(s); 0 failed to compile or were refused.", where master checks 59. With
a bad fence and a `rust,ignore` fence added to README.md, it fails with
`README.md:131: error[E0308]: mismatched types` and `README.md:135: fence info
"rust,ignore" is neither "rust" nor "{.rust .no-run}", so it would be skipped`.
- The Rust lib tests, the `--no-run` builds, `cargo fmt`, the stub audit and
ruff pass.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5
This pull request and its description were written by Isaac.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]