From 58edce2b909d295f97ccfbaf13705185541eca13 Mon Sep 17 00:00:00 2001 From: kylechar Date: Fri, 17 Jun 2016 06:07:51 -0700 Subject: [PATCH] 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 --- git_cl.py | 2 +- presubmit_canned_checks.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/git_cl.py b/git_cl.py index 75be64e678..672d8849a4 100755 --- a/git_cl.py +++ b/git_cl.py @@ -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', diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 7ec058b74b..15e24e29d8 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -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()]