commit | 1fad9a9fb5e76f6ed8fea8728053a2929fd0f9c6 | [log] [tgz] |
---|---|---|
author | Yeabkal Wubshit <yeabkal@google.com> | Thu Jan 14 09:12:28 2021 -0800 |
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Mon Mar 27 22:49:36 2023 +0000 |
tree | 6db3349de647de7ad82fa5d144feca6dda78cfcc | |
parent | a046682be9914869f6fb7c37c8bcb427eb5ace50 [diff] |
Add robolectric and robotests as test-file subpath Bug: 177482006 Test: deny-listed checks for test classes not run in tests with the added subpaths (cherry picked from commit fa2f37f2ac80a81c8d0ec45d1521485946a2ea3a) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3bf73caf790b21488bffbeb95c0b2eea94db8630) Merged-In: I4bd2a5edca3935f20ae4a9a893d2a5e035381001 Change-Id: I4bd2a5edca3935f20ae4a9a893d2a5e035381001
Checkstyle is used by developers to validate Java code style and formatting, and can be run as part of the pre-upload hooks.
It can be invoked in two ways.
checkstyle.py -f FILE [FILE ...]
checkstyle.py
A development tool to help programmers write Java code that adheres to a coding standard.
Git-lint is a tool to run lint checks on only files changed in the latest commit.
To run checkstyle as part of the pre-upload hooks, add the following line to your PREUPLOAD.cfg
:
checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT}
Note that checkstyle does not always agree with clang-format, and so it's best to only have one enabled for Java.
In .clang-format
add the following to disable format checking and correcting for Java:
--- Language: Java DisableFormat: true SortIncludes: false ---
In some versions of clang-format, DisableFormat
doesn't stop the sorting of includes. So to fully disable clang-format from doing anything for Java files, both options are needed.