This PR fixes the intermittent errors we see in the style-files hook of the pre-commit workflow by setting require_serial to true for the hook our pre-commit config. This config value prevents pre-commit from running in parallel, which is the root cause of the error.
This change also has the nice side effect of decreasing the runtime of the hook. See here for a workflow run that times style-files when run in parallel (real clock time 5.6s) and here for a workflow run that times it when run serially (real clock time 2.4s). These timings are consistent with what I saw locally, so I think the numbers are solid. My guess is that we have few enough R files in the repo such that the overhead of forking the process outweighs the benefit of styling multiple files in parallel.
This PR fixes the intermittent errors we see in the
style-files
hook of thepre-commit
workflow by settingrequire_serial
totrue
for the hook our pre-commit config. This config value prevents pre-commit from running in parallel, which is the root cause of the error.This change also has the nice side effect of decreasing the runtime of the hook. See here for a workflow run that times
style-files
when run in parallel (real clock time 5.6s) and here for a workflow run that times it when run serially (real clock time 2.4s). These timings are consistent with what I saw locally, so I think the numbers are solid. My guess is that we have few enough R files in the repo such that the overhead of forking the process outweighs the benefit of styling multiple files in parallel.