tag | fa58366a67c38106727b2d125b499c8849e6e5c7 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Mon Jun 08 14:44:54 2020 -0700 |
object | b342d76fa07aaf7223825221639e8de57c938f7c |
Platform Tools Release 30.0.2 (6538114)
commit | b342d76fa07aaf7223825221639e8de57c938f7c | [log] [tgz] |
---|---|---|
author | android-build-prod (mdb) <android-build-team-robot@google.com> | Thu Mar 12 22:00:29 2020 +0000 |
committer | android-build-prod (mdb) <android-build-team-robot@google.com> | Thu Mar 12 22:00:29 2020 +0000 |
tree | 7f045a04c99cd6ac43165fa64c82e297dfd0d43c | |
parent | 27085734136366973417c0840c0d23d0e46152e6 [diff] | |
parent | 2e69c77cd636a442ea9f13c5b256cb0ae773efaf [diff] |
Snap for 6290619 from 2e69c77cd636a442ea9f13c5b256cb0ae773efaf to sdk-release Change-Id: I95573f623000fd23543837eca9729fbac95d1781
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.