Skip to content

Commit 9df3054

Browse files
branchseerclaude
andcommitted
fix(ci): clippy empty_line_after_doc_comments + oxfmt on output_cache_test
- The three-line module-level header in `tracked_accesses.rs` was written as `///` followed by a blank line, which newer clippy flags as `empty_line_after_doc_comments` (the `///` attached itself to `PathRead` below). Switch it to `//` so it is a plain comment. - Apply oxfmt to `output_cache_test/snapshots.toml` to unblock the Format and Check Deps CI step. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent aec47db commit 9df3054

2 files changed

Lines changed: 162 additions & 34 deletions

File tree

crates/vite_task/src/session/execute/tracked_accesses.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use vite_path::{AbsolutePath, RelativePathBuf};
88

99
use crate::collections::HashMap;
1010

11-
/// User-configured negative globs are NOT applied here. They are applied later,
12-
/// separately for reads (input config) and writes (output config), since those
13-
/// two configs are independent.
11+
// User-configured negative globs are NOT applied here. They are applied later,
12+
// separately for reads (input config) and writes (output config), since those
13+
// two configs are independent.
1414

1515
/// Path read access info
1616
#[derive(Debug, Clone, Copy)]

crates/vite_task_bin/tests/e2e_snapshots/fixtures/output_cache_test/snapshots.toml

Lines changed: 159 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,31 @@ Auto output detection (default): output files written by the task are
55
restored on a cache hit.
66
"""
77
steps = [
8-
{ argv = ["vt", "run", "auto-output"], comment = "first run writes dist/out.txt" },
9-
{ argv = ["vtt", "print-file", "dist/out.txt"], comment = "output exists after the build" },
10-
{ argv = ["vtt", "rm", "dist/out.txt"], comment = "delete only the file (keep dir to avoid an fspy inferred-input miss on Windows)" },
11-
{ argv = ["vt", "run", "auto-output"], comment = "cache hit, should restore dist/out.txt" },
12-
{ argv = ["vtt", "print-file", "dist/out.txt"], comment = "output was restored from the archive" },
8+
{ argv = [
9+
"vt",
10+
"run",
11+
"auto-output",
12+
], comment = "first run writes dist/out.txt" },
13+
{ argv = [
14+
"vtt",
15+
"print-file",
16+
"dist/out.txt",
17+
], comment = "output exists after the build" },
18+
{ argv = [
19+
"vtt",
20+
"rm",
21+
"dist/out.txt",
22+
], comment = "delete only the file (keep dir to avoid an fspy inferred-input miss on Windows)" },
23+
{ argv = [
24+
"vt",
25+
"run",
26+
"auto-output",
27+
], comment = "cache hit, should restore dist/out.txt" },
28+
{ argv = [
29+
"vtt",
30+
"print-file",
31+
"dist/out.txt",
32+
], comment = "output was restored from the archive" },
1333
]
1434

1535
[[e2e]]
@@ -19,12 +39,36 @@ Glob output: only files matching the configured output globs are restored
1939
on a cache hit; files produced outside those globs are left alone.
2040
"""
2141
steps = [
22-
{ argv = ["vt", "run", "glob-output"], comment = "first run writes dist/out.txt and tmp/temp.txt" },
23-
{ argv = ["vtt", "rm", "dist/out.txt"], comment = "delete the glob-matched output" },
24-
{ argv = ["vtt", "rm", "tmp/temp.txt"], comment = "delete the non-matched output" },
25-
{ argv = ["vt", "run", "glob-output"], comment = "cache hit: should restore dist/out.txt but not tmp/temp.txt" },
26-
{ argv = ["vtt", "print-file", "dist/out.txt"], comment = "dist/out.txt was restored" },
27-
{ argv = ["vtt", "print-file", "tmp/temp.txt"], comment = "should fail - tmp not in output globs" },
42+
{ argv = [
43+
"vt",
44+
"run",
45+
"glob-output",
46+
], comment = "first run writes dist/out.txt and tmp/temp.txt" },
47+
{ argv = [
48+
"vtt",
49+
"rm",
50+
"dist/out.txt",
51+
], comment = "delete the glob-matched output" },
52+
{ argv = [
53+
"vtt",
54+
"rm",
55+
"tmp/temp.txt",
56+
], comment = "delete the non-matched output" },
57+
{ argv = [
58+
"vt",
59+
"run",
60+
"glob-output",
61+
], comment = "cache hit: should restore dist/out.txt but not tmp/temp.txt" },
62+
{ argv = [
63+
"vtt",
64+
"print-file",
65+
"dist/out.txt",
66+
], comment = "dist/out.txt was restored" },
67+
{ argv = [
68+
"vtt",
69+
"print-file",
70+
"tmp/temp.txt",
71+
], comment = "should fail - tmp not in output globs" },
2872
]
2973

3074
[[e2e]]
@@ -35,10 +79,26 @@ Auto output works even when input tracking is explicit
3579
are independent.
3680
"""
3781
steps = [
38-
{ argv = ["vt", "run", "auto-output-no-auto-input"], comment = "first run: input src/** (no auto), output default (auto)" },
39-
{ argv = ["vtt", "rm", "dist/out.txt"], comment = "delete the output" },
40-
{ argv = ["vt", "run", "auto-output-no-auto-input"], comment = "cache hit - output files should still be restored" },
41-
{ argv = ["vtt", "print-file", "dist/out.txt"], comment = "output was restored" },
82+
{ argv = [
83+
"vt",
84+
"run",
85+
"auto-output-no-auto-input",
86+
], comment = "first run: input src/** (no auto), output default (auto)" },
87+
{ argv = [
88+
"vtt",
89+
"rm",
90+
"dist/out.txt",
91+
], comment = "delete the output" },
92+
{ argv = [
93+
"vt",
94+
"run",
95+
"auto-output-no-auto-input",
96+
], comment = "cache hit - output files should still be restored" },
97+
{ argv = [
98+
"vtt",
99+
"print-file",
100+
"dist/out.txt",
101+
], comment = "output was restored" },
42102
]
43103

44104
[[e2e]]
@@ -48,12 +108,36 @@ Negative output globs exclude matching files from the cache archive, so
48108
they are not restored on a cache hit even though the task produced them.
49109
"""
50110
steps = [
51-
{ argv = ["vt", "run", "negative-output"], comment = "first run writes dist/out.txt and dist/cache/tmp.txt" },
52-
{ argv = ["vtt", "rm", "dist/out.txt"], comment = "delete the archived output" },
53-
{ argv = ["vtt", "rm", "dist/cache/tmp.txt"], comment = "delete the excluded output" },
54-
{ argv = ["vt", "run", "negative-output"], comment = "cache hit: should restore dist/out.txt but NOT dist/cache/tmp.txt" },
55-
{ argv = ["vtt", "print-file", "dist/out.txt"], comment = "dist/out.txt was restored" },
56-
{ argv = ["vtt", "print-file", "dist/cache/tmp.txt"], comment = "should fail - excluded by !dist/cache/**" },
111+
{ argv = [
112+
"vt",
113+
"run",
114+
"negative-output",
115+
], comment = "first run writes dist/out.txt and dist/cache/tmp.txt" },
116+
{ argv = [
117+
"vtt",
118+
"rm",
119+
"dist/out.txt",
120+
], comment = "delete the archived output" },
121+
{ argv = [
122+
"vtt",
123+
"rm",
124+
"dist/cache/tmp.txt",
125+
], comment = "delete the excluded output" },
126+
{ argv = [
127+
"vt",
128+
"run",
129+
"negative-output",
130+
], comment = "cache hit: should restore dist/out.txt but NOT dist/cache/tmp.txt" },
131+
{ argv = [
132+
"vtt",
133+
"print-file",
134+
"dist/out.txt",
135+
], comment = "dist/out.txt was restored" },
136+
{ argv = [
137+
"vtt",
138+
"print-file",
139+
"dist/cache/tmp.txt",
140+
], comment = "should fail - excluded by !dist/cache/**" },
57141
]
58142

59143
[[e2e]]
@@ -63,9 +147,23 @@ Changing a task's output configuration invalidates the cache entry —
63147
the next run is a miss, not a hit of the stale archive.
64148
"""
65149
steps = [
66-
{ argv = ["vt", "run", "output-config-change"], comment = "first run populates the cache" },
67-
{ argv = ["vtt", "replace-file-content", "vite-task.json", "REPLACE_ME", "dist/**"], comment = "change the output globs in the task config" },
68-
{ argv = ["vt", "run", "output-config-change"], comment = "cache miss: output config changed" },
150+
{ argv = [
151+
"vt",
152+
"run",
153+
"output-config-change",
154+
], comment = "first run populates the cache" },
155+
{ argv = [
156+
"vtt",
157+
"replace-file-content",
158+
"vite-task.json",
159+
"REPLACE_ME",
160+
"dist/**",
161+
], comment = "change the output globs in the task config" },
162+
{ argv = [
163+
"vt",
164+
"run",
165+
"output-config-change",
166+
], comment = "cache miss: output config changed" },
69167
]
70168

71169
[[e2e]]
@@ -77,10 +175,26 @@ rewriting dist/ won't mark inputs as modified), but default auto output
77175
should still capture dist writes and restore them on a cache hit.
78176
"""
79177
steps = [
80-
{ argv = ["vt", "run", "input-neg-dist-auto-output"], comment = "first run writes dist/out.txt" },
81-
{ argv = ["vtt", "rm", "dist/out.txt"], comment = "delete the output" },
82-
{ argv = ["vt", "run", "input-neg-dist-auto-output"], comment = "cache hit should restore dist/out.txt" },
83-
{ argv = ["vtt", "print-file", "dist/out.txt"], comment = "output was restored despite dist/** being a negative input glob" },
178+
{ argv = [
179+
"vt",
180+
"run",
181+
"input-neg-dist-auto-output",
182+
], comment = "first run writes dist/out.txt" },
183+
{ argv = [
184+
"vtt",
185+
"rm",
186+
"dist/out.txt",
187+
], comment = "delete the output" },
188+
{ argv = [
189+
"vt",
190+
"run",
191+
"input-neg-dist-auto-output",
192+
], comment = "cache hit should restore dist/out.txt" },
193+
{ argv = [
194+
"vtt",
195+
"print-file",
196+
"dist/out.txt",
197+
], comment = "output was restored despite dist/** being a negative input glob" },
84198
]
85199

86200
[[e2e]]
@@ -92,7 +206,21 @@ still needs fspy for write tracking, but reads outside `input: [\"src/**\"]`
92206
should be ignored.
93207
"""
94208
steps = [
95-
{ argv = ["vt", "run", "explicit-input-auto-output"], comment = "first run reads README.md (not in input globs) and captures the output" },
96-
{ argv = ["vtt", "replace-file-content", "README.md", "v1", "v2"], comment = "modify README.md — not an input, so it must not invalidate the cache" },
97-
{ argv = ["vt", "run", "explicit-input-auto-output"], comment = "cache hit: README.md not in input globs" },
209+
{ argv = [
210+
"vt",
211+
"run",
212+
"explicit-input-auto-output",
213+
], comment = "first run reads README.md (not in input globs) and captures the output" },
214+
{ argv = [
215+
"vtt",
216+
"replace-file-content",
217+
"README.md",
218+
"v1",
219+
"v2",
220+
], comment = "modify README.md — not an input, so it must not invalidate the cache" },
221+
{ argv = [
222+
"vt",
223+
"run",
224+
"explicit-input-auto-output",
225+
], comment = "cache hit: README.md not in input globs" },
98226
]

0 commit comments

Comments
 (0)