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)
This commit is contained in:
Jeff Epler 2021-03-15 17:53:49 -05:00
parent ed61e8955d
commit 0403a2cca5
1 changed files with 1 additions and 4 deletions

View File

@ -167,10 +167,7 @@ def main():
for file in lang_files(C_EXTS): for file in lang_files(C_EXTS):
fixup_c(file) fixup_c(file)
# Revert "// |" back to "//|" # Revert "// |" back to "//|"
subprocess.call( batch(["sed", "-i", "s,^// |,//|,"], lang_files(C_EXTS))
"find shared-bindings ports/*/bindings -name '*.c' -exec sed -i 's/\/ |/\/|/' {} \;",
shell=True,
)
# Format Python files with black. # Format Python files with black.
if format_py: if format_py: