Skip to content

Instantly share code, notes, and snippets.

@natiginfo
Last active May 22, 2019 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natiginfo/b815be7ded4b2b845baea8783f7e2a53 to your computer and use it in GitHub Desktop.
Save natiginfo/b815be7ded4b2b845baea8783f7e2a53 to your computer and use it in GitHub Desktop.
Script for running ktlint only on files that differs from master branch
#!/bin/bash
CHANGED_FILES=($(git diff master --name-only "*.kt"))
for file_path in "${CHANGED_FILES[@]}"
do
ktlint ${file_path}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment