From 632246792fb208280a048fb2497a309c5a4d3690 Mon Sep 17 00:00:00 2001 From: Henrik Kjellander Date: Tue, 8 Sep 2015 08:03:56 +0200 Subject: [PATCH] PRESUBMIT: Exclude some files from 80-character limit check. Exclude the following files from 80-characters line limit check: * DEPS * GN files (.gn and .gni) * GYP files (.gyp and .gypi) BUG=webrtc:4794 TESTED=Ran the presubmit check with a modified DEPS and GYP file before this change and verified it failed. Re-ran after these changes and verified it passed. I also tested editing a .cc file to be >80 chars and verified the check found it. R=andrew@webrtc.org, sergiyb@chromium.org Review URL: https://codereview.webrtc.org/1323943012 . Cr-Commit-Position: refs/heads/master@{#9877} --- PRESUBMIT.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PRESUBMIT.py b/PRESUBMIT.py index c429009199..cf9c8450b5 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -292,8 +292,12 @@ def _CommonChecks(input_api, output_api): # WebRTC can't use the presubmit_canned_checks.PanProjectChecks function since # we need to have different license checks in talk/ and webrtc/ directories. # Instead, hand-picked checks are included below. + + # Skip long-lines check for DEPS, GN and GYP files. + long_lines_sources = lambda x: input_api.FilterSourceFile(x, + black_list=(r'.+\.gyp$', r'.+\.gypi$', r'.+\.gn$', r'.+\.gni$', 'DEPS')) results.extend(input_api.canned_checks.CheckLongLines( - input_api, output_api, maxlen=80)) + input_api, output_api, maxlen=80, source_file_filter=long_lines_sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace(