A pre-commit hook to run ktfmt.
This commit hook requires Python >=3.8
.
ktfmt
requires Java 11. The java
in your PATH
must be version >=11
.
Add the following lines to your .pre-commit-config.yaml
.
- repo: https://github.com/davehadley/ktfmt-pre-commit-hook
rev: 0.8.0
hooks:
- id: ktfmt
stages: [commit]
To specify a specific version of ktfmt
pass --version=XX.YY.ZZ
with the args
option.
All other args
provided will be passed onto ktfmt
. For example:
- repo: https://github.com/davehadley/ktfmt-pre-commit-hook
rev: 0.8.0
hooks:
- id: ktfmt
args: [--version=0.53, --dropbox-style]
stages: [commit]
See the ktfmt documentation for supported command line arguments.
Please report any bugs in the issue tracker.
Run source setup.sh
to setup the development environment.
This may be slow the first time that this is run as the virtual environment is created
and dependencies are installed.
Run:
poetry install
poetry run pytest tests
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.