ccao-data / model-res-avm

Automated valuation model for all class 200 residential properties in Cook County (except vacant land and condos)
GNU Affero General Public License v3.0
20 stars 3 forks source link

Fix file permissions error in `style-files` pre-commit hook #244

Closed jeancochrane closed 1 month ago

jeancochrane commented 1 month ago

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.

jeancochrane commented 1 month ago

Tagging @wagnerlmichael in here in case you are interested in knowing more about this fix!