commit | 7181b30deb272f14d3c7ddd5e2d79cad0b87a498 | [log] [tgz] |
---|---|---|
author | Tanat Boozayaangool <tanatb@google.com> | Thu Nov 10 15:11:05 2022 +0000 |
committer | Tanat Boozayaangool <tanatb@google.com> | Thu Nov 10 15:37:18 2022 +0000 |
tree | 03c899689585d816527a7c1eba74df3f98671beb | |
parent | 61b1349601b95ebd8f4bc8caf9f06d0090f157c3 [diff] |
Add 'perfetto' to order of java imports Makes sure that the presubmimt doesn't fail after the file has been formatted by the formatter. Bug: 258662881 Change-Id: I2981f33b2a7856b4c0b86b58599ca68a2704a19c
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.