Repository navigation
Commit 879c8fb
authored
dev: include examples README checks in the local lint suite (apache#25466)
## Which issue does this PR close?
- Part of apache#21048.
## Rationale for this change
`dev/rust_lint.sh` does not run the examples README check from the
`examples-docs-check` job. A contributor finds a stale
`datafusion-examples/README.md` only in CI. The script also writes to a
fixed `README-NEW.md` and a shared file under `/tmp`, and its update
hint is a pipeline that does not work.
## What changes are included in this PR?
- `ci/scripts/check_examples_docs.sh` writes its generated README and
diff into a scratch directory created per run and removes it on exit,
including on interruption. A `diff` error is reported as a comparison
failure, not as a stale README.
- The script gets `--write` and `--allow-dirty`, with the same
clean-tree rule as `rust_fmt.sh`. `--write` replaces the README with the
generated one. Without it, the script only reports and tells the
contributor to rerun with `--write`.
- `dev/rust_lint.sh` runs the script as a write step, so
`./dev/rust_lint.sh --write` updates the README with the other
formatters.
- `docs/source/contributor-guide/testing.md` documents the check and the
update command.
The generator command, the Prettier version, and the comparison do not
change. CI calls the script the same way as before.
## What is the testing strategy for this PR?
- In a clean clone: a fresh README passes, a committed stale README
fails with the diff, `--write` restores it byte for byte, `--write` on a
dirty tree is refused, and `--write --allow-dirty` runs. No lockfile
changed.
- A fixture with stub `cargo` and `npx` covered generator and formatter
failures in both modes, a `diff` error, a missing `npx`, SIGINT and
SIGTERM cleanup, concurrent runs, and a run from a subdirectory. The
README was untouched in every failure case.
- A fixture with stubbed steps covered the runner: flags are forwarded
in both write modes and absent in check mode, and a failure stops later
steps. The full `./dev/rust_lint.sh` passes.
## Are there any user-facing changes?
No.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 64871d9 commit 879c8fb
3 files changed
Lines changed: 114 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
32 | 24 | | |
33 | 25 | | |
34 | 26 | | |
35 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
36 | 68 | | |
37 | | - | |
38 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
39 | 86 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 87 | + | |
43 | 88 | | |
44 | 89 | | |
45 | 90 | | |
46 | | - | |
| 91 | + | |
47 | 92 | | |
48 | | - | |
| 93 | + | |
49 | 94 | | |
50 | 95 | | |
51 | 96 | | |
52 | 97 | | |
53 | | - | |
| 98 | + | |
54 | 99 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
75 | 104 | | |
76 | 105 | | |
77 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
278 | 291 | | |
279 | 292 | | |
280 | 293 | | |
| |||
0 commit comments