Enforce GN formatting for *.typemap files.

Ensure consistent formatting for Mojo typemap files that define the
build rules to generate StructTraits.

BUG=620799
TEST=Tested locally, both presubmit and git cl format work as expected.

Review-Url: https://codereview.chromium.org/2074793002
changes/90/365990/1
kylechar 10 years ago committed by Commit bot
parent 7d44639eb2
commit 58edce2b90

@ -4778,7 +4778,7 @@ def MatchingFileType(file_name, extensions):
def CMDformat(parser, args):
"""Runs auto-formatting tools (clang-format etc.) on the diff."""
CLANG_EXTS = ['.cc', '.cpp', '.h', '.mm', '.proto', '.java']
GN_EXTS = ['.gn', '.gni']
GN_EXTS = ['.gn', '.gni', '.typemap']
parser.add_option('--full', action='store_true',
help='Reformat the full content of all touched files')
parser.add_option('--dry-run', action='store_true',

@ -1170,7 +1170,8 @@ def CheckGNFormatted(input_api, output_api):
affected_files = input_api.AffectedFiles(
include_deletes=False,
file_filter=lambda x: x.LocalPath().endswith('.gn') or
x.LocalPath().endswith('.gni'))
x.LocalPath().endswith('.gni') or
x.LocalPath().endswith('.typemap'))
warnings = []
for f in affected_files:
cmd = ['gn', 'format', '--dry-run', f.AbsoluteLocalPath()]

Loading…
Cancel
Save