Sign inSign up

nemooudeis/ktlint

By nemooudeis

•Updated about 5 years ago

Run ktlint checks on CI

Image
0

50K+

nemooudeis/ktlint repository overview

⁠ktlint⁠ container, build for CI Pipelines

Source code is here -> https://github.com/NemoOudeis/ci-docker/tree/master/ktlint⁠

You can use this container to run ktlint⁠ without installation (maybe on a remote machine)

docker run --rm --mount type=bind,src=${PWD},dst=/code nemooudeis/ktlint ktlint "/code/**/*.kt"

Or use it as a step within your build pipeline, in particular if your test are slow and fast feedback of ktlint is valuable, e.g. with CircleCI

jobs:
  ktlint:
    docker: 
      - image: nemooudeis/ktlint
    steps:
      - checkout
      - run: 
          name: ktlint to check for code style violations in changes between PR and origin/master
          command: |
            set +e # allow grep to fail without failing the whole step (in cases no kotlin files were changed)
            files=$(git diff $(git show-ref origin/master -s) HEAD --name-only --relative | grep '\.kt[s"]\?$')
            [ -z "$files" ] && echo "no kotin files changed, all good!" && exit 0
            echo $files | xargs ktlint --relative .

  build: # actual build, test, deploy etc jobs

workflows:
  version: 2
  build_and_publish:
    jobs:
      - ktlint
      - build:
          requires:
            - ktlint

Tag summary

Content type

Image

Digest

Size

170.1 MB

Last updated

about 5 years ago

docker pull nemooudeis/ktlint