File tree Expand file tree Collapse file tree 4 files changed +45
-3
lines changed Expand file tree Collapse file tree 4 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 44
55cd " $( dirname " $0 " ) /.."
66
7- echo " ==> Running formatters"
8- ./gradlew format
7+ if command -v ktfmt & > /dev/null; then
8+ echo " ==> Running ktfmt"
9+ ./scripts/kotlin-format
10+ else
11+ echo " ==> Running gradlew formatKotlin"
12+ ./gradlew formatKotlin
13+ fi
14+
15+ if command -v palantir-java-format & > /dev/null; then
16+ echo " ==> Running palantir-java-format"
17+ ./scripts/java-format
18+ else
19+ echo " ==> Running gradlew formatJava"
20+ ./gradlew formatJava
21+ fi
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ cd " $( dirname " $0 " ) /.."
6+
7+ find . -name " *.java" -not -path " ./buildSrc/build/*" -print0 | xargs -0 -r palantir-java-format --palantir --replace " $@ "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ cd " $( dirname " $0 " ) /.."
6+
7+ find . -name " *.kt" -not -path " ./buildSrc/build/*" -print0 | xargs -0 -r ktfmt --kotlinlang-style " $@ "
Original file line number Diff line number Diff line change 55cd " $( dirname " $0 " ) /.."
66
77echo " ==> Running lints"
8- ./gradlew lint
8+
9+ if command -v ktfmt & > /dev/null; then
10+ echo " ==> Checking ktfmt"
11+ ./scripts/kotlin-format --dry-run --set-exit-if-changed
12+ else
13+ echo " ==> Running gradlew lintKotlin"
14+ ./gradlew lintKotlin
15+ fi
16+
17+ if command -v palantir-java-format & > /dev/null; then
18+ echo " ==> Checking palantir-java-format"
19+ ./scripts/java-format --dry-run --set-exit-if-changed
20+ else
21+ echo " ==> Running gradlew lintJava"
22+ ./gradlew lintJava
23+ fi
You can’t perform that action at this time.
0 commit comments