Commit 9819b1bf authored by thakis@chromium.org's avatar thakis@chromium.org

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
parent e480fb76
......@@ -2769,7 +2769,7 @@ def CMDowners(parser, args):
@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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment