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):
fixup_c(file)
# Revert "// |" back to "//|"
subprocess.call(
"find shared-bindings ports/*/bindings -name '*.c' -exec sed -i 's/\/ |/\/|/' {} \;",
shell=True,
)
batch(["sed", "-i", "s,^// |,//|,"], lang_files(C_EXTS))
# Format Python files with black.
if format_py: