Skip to content

Handle pre-commit paralellism on first installation

Compare
Choose a tag to compare
@elmi82 elmi82 released this 01 Apr 12:13
· 9 commits to master since this release
e733cde

When the hook is run for the first time ktlint is installed. There was a check in the script that checked whether ktlint was already downloaded. Since pre-commit is running the script multiple times in parallel, there was a race condition on the first usage of the hook. In this case some executions would try to execute ktlint although the download wasn't finished yet.

To prevent this we are now protecting the installation by a semaphore.