OLD | NEW |
1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 import json | 9 import json |
10 import os | 10 import os |
11 import re | 11 import re |
12 import subprocess | 12 import subprocess |
13 import sys | 13 import sys |
14 from collections import defaultdict | 14 from collections import defaultdict |
15 | 15 |
16 | 16 |
17 # Files and directories that are *skipped* by cpplint in the presubmit script. | 17 # Files and directories that are *skipped* by cpplint in the presubmit script. |
18 CPPLINT_BLACKLIST = [ | 18 CPPLINT_BLACKLIST = [ |
19 'api/video_codecs/video_decoder.h', | 19 'api/video_codecs/video_decoder.h', |
20 'common_types.cc', | 20 'common_types.cc', |
21 'common_types.h', | 21 'common_types.h', |
22 'examples/objc', | 22 'examples/objc', |
23 'media', | 23 'media', |
24 'modules/audio_coding', | 24 'modules/audio_coding', |
25 'modules/audio_conference_mixer', | |
26 'modules/audio_device', | 25 'modules/audio_device', |
27 'modules/audio_processing', | 26 'modules/audio_processing', |
28 'modules/desktop_capture', | 27 'modules/desktop_capture', |
29 'modules/include/module_common_types.h', | 28 'modules/include/module_common_types.h', |
30 'modules/media_file', | 29 'modules/media_file', |
31 'modules/utility', | 30 'modules/utility', |
32 'modules/video_capture', | 31 'modules/video_capture', |
33 'p2p', | 32 'p2p', |
34 'pc', | 33 'pc', |
35 'rtc_base', | 34 'rtc_base', |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 'media', | 66 'media', |
68 'modules/audio_device/include', | 67 'modules/audio_device/include', |
69 'pc', | 68 'pc', |
70 ) | 69 ) |
71 | 70 |
72 # These directories should not be used but are maintained only to avoid breaking | 71 # These directories should not be used but are maintained only to avoid breaking |
73 # some legacy downstream code. | 72 # some legacy downstream code. |
74 LEGACY_API_DIRS = ( | 73 LEGACY_API_DIRS = ( |
75 'common_audio/include', | 74 'common_audio/include', |
76 'modules/audio_coding/include', | 75 'modules/audio_coding/include', |
77 'modules/audio_conference_mixer/include', | |
78 'modules/audio_processing/include', | 76 'modules/audio_processing/include', |
79 'modules/bitrate_controller/include', | 77 'modules/bitrate_controller/include', |
80 'modules/congestion_controller/include', | 78 'modules/congestion_controller/include', |
81 'modules/include', | 79 'modules/include', |
82 'modules/remote_bitrate_estimator/include', | 80 'modules/remote_bitrate_estimator/include', |
83 'modules/rtp_rtcp/include', | 81 'modules/rtp_rtcp/include', |
84 'modules/rtp_rtcp/source', | 82 'modules/rtp_rtcp/source', |
85 'modules/utility/include', | 83 'modules/utility/include', |
86 'modules/video_coding/codecs/h264/include', | 84 'modules/video_coding/codecs/h264/include', |
87 'modules/video_coding/codecs/i420/include', | 85 'modules/video_coding/codecs/i420/include', |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 results = [] | 736 results = [] |
739 source_file_filter = lambda x: input_api.FilterSourceFile( | 737 source_file_filter = lambda x: input_api.FilterSourceFile( |
740 x, white_list=(r'.+\.proto$',)) | 738 x, white_list=(r'.+\.proto$',)) |
741 for f in input_api.AffectedSourceFiles(source_file_filter): | 739 for f in input_api.AffectedSourceFiles(source_file_filter): |
742 file_path = f.LocalPath() | 740 file_path = f.LocalPath() |
743 with open(file_path) as f: | 741 with open(file_path) as f: |
744 lines = f.readlines() | 742 lines = f.readlines() |
745 if len(lines) > 0 and not lines[-1].endswith('\n'): | 743 if len(lines) > 0 and not lines[-1].endswith('\n'): |
746 results.append(output_api.PresubmitError(error_msg.format(file_path))) | 744 results.append(output_api.PresubmitError(error_msg.format(file_path))) |
747 return results | 745 return results |
OLD | NEW |