Skip to content

tadodotcom/ktlint-pre-commit

This branch is 26 commits ahead of maltzj/ktlint-pre-commit:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2714213 · Nov 28, 2023

History

31 Commits
Mar 31, 2021
Jan 27, 2019
Nov 20, 2023
Nov 20, 2023

Repository files navigation

ktlint-pre-commit

A ktlint pre-commit hook

Usage:

repos:
- repo: https://github.com/tadodotcom/ktlint-pre-commit
  rev: "1.0.1"
  hooks:
      - id: ktlint

If you want to make use of the formatting functionality of ktlint you can configure the hook as follows:

repos:
- repo: https://github.com/tadodotcom/ktlint-pre-commit
  rev: "1.0.1"
  hooks:
      - id: ktlint
        args: [-F]

Notes:

  • This file stores ktlint in a .cache/ directory so that it doesn't need to be re-downloaded each time. You will probably want to add .cache/ to the .gitignore file of the project which uses this hook.
  • The first time this hook runs it will need to download ktlint, which takes a long time.