Github Action which ensures that Kotlin source code follows ktfmt style.
(Optional) The style the code should be formatted as (dropbox, google, or kotlinlang). Defaults to facebook style.
(Optional) The file or directory to apply ktfmt to. Defaults to all Kotlin files in the repository.
name: ktfmt
on:
pull_request:
paths:
- "**/*.kt"
- ".github/workflows/ktfmt.yml"
jobs:
ktlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: "ktfmt"
uses: rsookram/ktfmt-action@v1
with:
style: kotlinlang
You'll need to have a reasonably modern version of node
handy. This won't work with versions older than 9, for instance.
Install the dependencies
$ npm install
Build the typescript and package it for distribution
$ npm run build && npm run package
Run the tests
$ npm test