Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: PRESUBMIT.py

Issue 2037173002: Allow 100 char lines for ObjC files. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index b09fc14cefd5b5257968c7eed153e1f9a973a894..8492dc9fc888bed8f2c9edc473304f223baa71b9 100755
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -454,11 +454,22 @@ def _CommonChecks(input_api, output_api):
# we need to have different license checks in talk/ and webrtc/ directories.
# Instead, hand-picked checks are included below.
+ # .m and .mm files are ObjC files. For simplicity we will consider .h files in
+ # ObjC subdirectories ObjC headers.
+ objc_filter_list = (r'.+\.m$', r'.+\.mm$', r'.+objc\/.+\.h$')
kjellander_webrtc 2016/06/06 17:01:07 While we're at it, could you add .java to the list
# 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'))
+ build_file_filter_list = (r'.+\.gyp$', r'.+\.gypi$', r'.+\.gn$', r'.+\.gni$',
+ 'DEPS')
+ eighty_char_sources = lambda x: input_api.FilterSourceFile(x,
+ black_list=build_file_filter_list + objc_filter_list)
+ hundred_char_sources = lambda x: input_api.FilterSourceFile(x,
+ white_list=objc_filter_list)
results.extend(input_api.canned_checks.CheckLongLines(
- input_api, output_api, maxlen=80, source_file_filter=long_lines_sources))
+ input_api, output_api, maxlen=80, source_file_filter=eighty_char_sources))
+ results.extend(input_api.canned_checks.CheckLongLines(
+ input_api, output_api, maxlen=100,
+ source_file_filter=hundred_char_sources))
+
results.extend(input_api.canned_checks.CheckChangeHasNoTabs(
input_api, output_api))
results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698