Skip to content

Commit 0403a2c

Browse files
committed
codeformat: Run sed only on requested files
When running from pre-commit, we believe the different invocations of sed were racing with each other, sometimes leaving zero-byte files in the filesystem (ow)
1 parent ed61e89 commit 0403a2c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tools/codeformat.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,7 @@ def batch(cmd, files, N=200):
167167
for file in lang_files(C_EXTS):
168168
fixup_c(file)
169169
# Revert "// |" back to "//|"
170-
subprocess.call(
171-
"find shared-bindings ports/*/bindings -name '*.c' -exec sed -i 's/\/ |/\/|/' {} \;",
172-
shell=True,
173-
)
170+
batch(["sed", "-i", "s,^// |,//|,"], lang_files(C_EXTS))
174171

175172
# Format Python files with black.
176173
if format_py:

0 commit comments

Comments
 (0)