Let `git cl format` format java files, too.
This will only have an effect if one's buildtools checkout is new enough, since
only then:
a) clang-format will be new enough to do a decent job for java files
b) clang-format-diff.py will be new enough to look at java files
So for older buildtools checkouts, `git cl format` will continue to ignore java
files. For newer buildtools checkouts (like the one pulled by `gclient sync`
with a recent chromium checkout), it'll work and do a fairly decent job.
BUG=429372
Review URL: https://codereview.chromium.org/788933003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293312 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/git_cl.py b/git_cl.py
index d9b80aa..778c468 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2769,7 +2769,7 @@
@subcommand.usage('[files or directories to diff]')
def CMDformat(parser, args):
"""Runs clang-format on the diff."""
- CLANG_EXTS = ['.cc', '.cpp', '.h', '.mm', '.proto']
+ CLANG_EXTS = ['.cc', '.cpp', '.h', '.mm', '.proto', '.java']
parser.add_option('--full', action='store_true',
help='Reformat the full content of all touched files')
parser.add_option('--dry-run', action='store_true',