Skip to content

Releases: tadodotcom/ktlint-pre-commit

Use bash to support all required commands

01 Apr 12:37
77711cd
Compare
Choose a tag to compare

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

01 Apr 12:13
e733cde
Compare
Choose a tag to compare

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

01 Apr 08:46
98b8435
Compare
Choose a tag to compare
0.41.0-1

update to latest ktlint version and add various improvements #1