Commit 437b31e
committed
STYLE: Use
Use `writelines` instead of `write` in a loop.
Fixes:
```
- for val in bvals:
- fid.write(f'{val} ')
+ fid.writelines(f'{val} ' for val in bvals)
```
and other similar errors raised for example in:
https://github.com/nipy/nibabel/actions/runs/16092302666/job/45410655457?pr=1422#step:7:23
Documentation:
https://docs.astral.sh/ruff/rules/for-loop-writes/writelines instead of write in a loop1 parent b5ecf48 commit 437b31e
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
| 361 | + | |
363 | 362 | | |
364 | 363 | | |
365 | 364 | | |
| |||
374 | 373 | | |
375 | 374 | | |
376 | 375 | | |
377 | | - | |
378 | | - | |
| 376 | + | |
379 | 377 | | |
380 | 378 | | |
381 | 379 | | |
| |||
0 commit comments