-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit 16363f4
Enforce starting newlines (#563)
This is an example of what I've been suggesting at
#506 (+ some linked issues):
- ~Stacked on #528 so that would
need to merge first~
- Enforces the correct number of newlines at the start of snapshots. The
start is easier because we don't need to worry about editor issues in
trailing newlines (and don't need to worry about how `Lines` deals
ambiguously with trailing new lines)
- Works for both inline & file snapshots
- Adds a `matches_legacy` method on snapshot contents — this
encapsulates the older formats we still support and warns about them
~It's not ready to merge yet, because we don't seem to actually support
`--force-update-snapshots` on inline values, which is somewhat required.
But I'm publishing for feedback & to put some weight on #528 in case we
don't want to pursue.~
---------
Co-authored-by: Claude <no-reply@anthropic.com>1 parent 0d79fa9 commit 16363f4
File tree
9 files changed
+619
-153
lines changed- cargo-insta/tests/functional
- insta/src
9 files changed
+619
-153
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | + | ||
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | - | ||
30 | - | ||
29 | + | ||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | - | ||
70 | - | ||
68 | + | ||
71 | 69 | | |
72 | 70 | | |
73 | 71 | | |
| |||
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
126 | - | ||
127 | - | ||
124 | + | ||
128 | 125 | | |
129 | 126 | | |
130 | 127 | | |
| |||
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
150 | - | ||
151 | - | ||
147 | + | ||
152 | 148 | | |
153 | 149 | | |
154 | 150 | | |
| |||
199 | 195 | | |
200 | 196 | | |
201 | 197 | | |
202 | - | ||
203 | - | ||
198 | + | ||
204 | 199 | | |
205 | 200 | | |
206 | 201 | | |
| |||
237 | 232 | | |
238 | 233 | | |
239 | 234 | | |
240 | - | ||
241 | - | ||
235 | + | ||
242 | 236 | | |
243 | 237 | | |
244 | 238 | | |
| |||
268 | 262 | | |
269 | 263 | | |
270 | 264 | | |
271 | - | ||
272 | - | ||
265 | + | ||
273 | 266 | | |
274 | 267 | | |
275 | 268 | | |
| |||
308 | 301 | | |
309 | 302 | | |
310 | 303 | | |
311 | - | ||
312 | - | ||
304 | + | ||
313 | 305 | | |
314 | 306 | | |
315 | 307 | | |
| |||
340 | 332 | | |
341 | 333 | | |
342 | 334 | | |
343 | - | ||
344 | - | ||
335 | + | ||
345 | 336 | | |
346 | 337 | | |
347 | 338 | | |
| |||
381 | 372 | | |
382 | 373 | | |
383 | 374 | | |
384 | - | ||
385 | - | ||
375 | + | ||
386 | 376 | | |
387 | 377 | | |
388 | 378 | | |
| |||
411 | 401 | | |
412 | 402 | | |
413 | 403 | | |
414 | - | ||
415 | - | ||
404 | + | ||
416 | 405 | | |
417 | 406 | | |
418 | 407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | - | ||
49 | - | ||
48 | + | ||
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | - | ||
74 | - | ||
72 | + | ||
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
| |||
116 | 114 | | |
117 | 115 | | |
118 | 116 | | |
119 | - | ||
120 | - | ||
117 | + | ||
121 | 118 | | |
122 | 119 | | |
123 | 120 | | |
| |||
158 | 155 | | |
159 | 156 | | |
160 | 157 | | |
161 | - | ||
162 | - | ||
158 | + | ||
163 | 159 | | |
164 | 160 | | |
165 | 161 | | |
| |||
183 | 179 | | |
184 | 180 | | |
185 | 181 | | |
186 | - | ||
187 | - | ||
182 | + | ||
188 | 183 | | |
189 | 184 | | |
190 | 185 | | |
| |||
206 | 201 | | |
207 | 202 | | |
208 | 203 | | |
209 | - | ||
210 | - | ||
204 | + | ||
211 | 205 | | |
212 | 206 | | |
213 | 207 | | |
| |||
250 | 244 | | |
251 | 245 | | |
252 | 246 | | |
253 | - | ||
254 | - | ||
247 | + | ||
255 | 248 | | |
256 | 249 | | |
257 | 250 | | |
| |||
0 commit comments