From 002d8a6e922bb8b8a4fc1ce81b5ad445f9da3820 Mon Sep 17 00:00:00 2001 From: Yuyang Huang Date: Fri, 13 Dec 2024 12:13:08 +0900 Subject: [PATCH] Disable ktfmt and rely solely on ktlint for Kotlin linting This change disables the ktfmt tool and uses only ktlint for linting Kotlin files. Due to previous bugs (fixed in aosp/3391169), ktfmt was not functioning correctly before. Enabling ktfmt will cause entire files to be reformatted without specific error reporting. By relying solely on ktlint, we ensure more precise and informative linting feedback. Test: TH Change-Id: Iad58badb4fc431e52a5b02489cfa6cd46712bf37 --- PREUPLOAD.cfg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg index 39009cbcf4..c301397593 100644 --- a/PREUPLOAD.cfg +++ b/PREUPLOAD.cfg @@ -1,15 +1,13 @@ [Builtin Hooks] bpfmt = true clang_format = true -ktfmt = true [Builtin Hooks Options] clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp,hpp -ktfmt = --kotlinlang-style [Hook Scripts] checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT} -ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py --no-verify-format -f ${PREUPLOAD_FILES} +ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py --disabled-rules comment-wrapping -f ${PREUPLOAD_FILES} hidden_api_txt_checksorted_hook = ${REPO_ROOT}/tools/platform-compat/hiddenapi/checksorted_sha.sh ${PREUPLOAD_COMMIT} ${REPO_ROOT}