commit | 7071470e066ca89beaed4b1a91fb706158e9bd3a | [log] [tgz] |
---|---|---|
author | Makoto Onuki <omakoto@google.com> | Tue May 21 14:39:49 2024 -0700 |
committer | Makoto Onuki <omakoto@google.com> | Tue May 21 14:39:49 2024 -0700 |
tree | c56089069e4000e07c279b9c941d51ff7ec5645f | |
parent | 969e142daaa75a2a192f1086984609fcbb7ae654 [diff] |
Allow "$ravenwood" to be a method name suffix Ravenwood (see https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/ravenwood/README.md ) uses "$ravenwood" as a suffix for method replacement, so let's allow it as a valid suffix. Test: https://r.android.com/3096258 passes check Bug: 341354657 Change-Id: Ic0cde0ae51a525913ba62f7a8532c7fb6d273aba
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.