From eef0e37ba5e5ed743cee970a5f3c51f04c5c43ce Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Tue, 5 Sep 2023 12:35:15 +0300 Subject: [PATCH] Simpify arguments to Java/Kotlin formatters. pre-commit should already auto-find the right files and pass them to these hooks, and not passing them should I *think* mean it's harder for new implementers to forget adding explicitly to this list. Manually testing seems to confirm this is the case (by breaking a file and seeing ktlint complain). Though we're running into pinterest/ktlint#1618 (AKA pinterest/ktlint#1391) and I can't seem to figure out how to pass through JVM args... --- .pre-commit-config.yaml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b5c0b3d3d..e0c20ce29 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -101,24 +101,12 @@ repos: - repo: https://github.com/dustinsand/pre-commit-jvm rev: v0.9.0 hooks: - - name: ktlint (kotlin implementations) + - name: ktlint (java/kotlin implementations) id: ktlint - args: - [ - "--format", - "implementations/kotlin-kmp-json-schema-validator/**/*.kt", - "implementations/kotlin-kmp-json-schema-validator/*.kts", - "implementations/java-openapiprocessor/**/*.kt", - "implementations/java-openapiprocessor/*.kts", - ] - - name: detekt (kotlin implementations) + args: [--format] + - name: detekt (java/kotlin implementations) id: detekt - args: - [ - "--build-upon-default-config", - "--input", - "implementations/kotlin-kmp-json-schema-validator, implementations/java-openapiprocessor", - ] + args: ["--build-upon-default-config"] - name: pmd (java implementations) id: pmd args: