Releases: tadodotcom/ktlint-pre-commit
Releases · tadodotcom/ktlint-pre-commit
Use bash to support all required commands
Shell on GitHub actions did not support the exec
command. This enable the used of pre-commit in github actions.
With this a linting job can be configured as follows:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Update python environment
run: |
pip install --upgrade pre-commit
- name: Run all linters
run: pre-commit run --all-files
Handle pre-commit paralellism on first installation
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.
Ktlint updated to version 0.41.0
0.41.0-1 update to latest ktlint version and add various improvements #1