diff options
author | 2022-11-09 23:32:03 +0000 | |
---|---|---|
committer | 2022-11-23 15:28:25 +0000 | |
commit | 485e6881e537b50c9a751f2405a8c9028b56d3a6 (patch) | |
tree | daba7cd3e7a6e6b07a7cb2657f64ed885bcd17c0 /compiler/driver/compiler_options_map-inl.h | |
parent | 44ba423161241ee1b49c6e29e272f8c69f776231 (diff) |
Add clang-format preupload check.
This will check that new and changed lines conform to the style defined
in .clang-format. Specific code sections can be excluded if it gets in
the way (some examples included).
Also fix the java style to not line break in "/// CHECK" comments, and
use the AOSP style import order.
Java files in art/tools/ahat and art/tools/dexfuzz use indentation
width 2, so they get an override .clang-format with that style.
Java files in test/ have a mix of different indentation widths, so that
directory is excluded for the time being.
openjdkjvmti/include/jvmti.h is an imported file that should be ignored
altogether. However, it is not straightforward to configure a whole
file exclude. Upload it with --no-verify if it needs to be updated.
Test: clang-format -i art/dex2oat/dex2oat_options.cc \
art/benchmark/const-class/src/ConstClassBenchmark.java \
art/tools/ahat/src/main/com/android/ahat/heapdump/Parser.java \
art/tools/dexfuzz/src/dexfuzz/program/IdCreator.java
Check that reformatted files look reasonable
Test: Create a local commit with changes in both art/libartservice and
art/test, run tools/repohooks/pre-upload.py, and verify that only the
changes in art/libartservice get checked.
Bug: 181877164
Change-Id: I991ff032694bf5063e8516fdf71a95d0b047ffea
Diffstat (limited to 'compiler/driver/compiler_options_map-inl.h')
-rw-r--r-- | compiler/driver/compiler_options_map-inl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/driver/compiler_options_map-inl.h b/compiler/driver/compiler_options_map-inl.h index 6733a81d8a..79a59625f5 100644 --- a/compiler/driver/compiler_options_map-inl.h +++ b/compiler/driver/compiler_options_map-inl.h @@ -118,6 +118,7 @@ inline bool ReadCompilerOptions(Base& map, CompilerOptions* options, std::string template <typename Map, typename Builder> inline void AddCompilerOptionsArgumentParserOptions(Builder& b) { + // clang-format off b. Define("--compiler-filter=_") .template WithType<CompilerFilter::Filter>() @@ -256,6 +257,7 @@ inline void AddCompilerOptionsArgumentParserOptions(Builder& b) { .template WithType<unsigned int>() .WithHelp("Maximum solid block size for compressed images.") .IntoKey(Map::MaxImageBlockSize); + // clang-format on } #pragma GCC diagnostic pop |