summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2021-03-15 17:53:49 -0500
committerJeff Epler <jepler@gmail.com>2021-03-15 18:10:43 -0500
commit0403a2cca59ed24c0a71486e29d701220e8c4cf7 (patch)
treef92788bdb79e6c70fa65c772ff255d028bff3e26 /tools
parented61e8955d37bf4780c04130f05302d85314ef1b (diff)
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)
Diffstat (limited to 'tools')
-rw-r--r--tools/codeformat.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/codeformat.py b/tools/codeformat.py
index fb2a94e49..e9615ae56 100644
--- a/tools/codeformat.py
+++ b/tools/codeformat.py
@@ -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: