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

Side by Side Diff: tools/presubmit.py

Issue 3082: Rename flags.defs to flag-definitions.h.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/flags.defs ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2008 the V8 project authors. All rights reserved. 3 # Copyright 2008 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 Lint files to check that they follow the google code style. 127 Lint files to check that they follow the google code style.
128 """ 128 """
129 129
130 def IsRelevant(self, name): 130 def IsRelevant(self, name):
131 return name.endswith('.cc') or name.endswith('.h') 131 return name.endswith('.cc') or name.endswith('.h')
132 132
133 def IgnoreDir(self, name): 133 def IgnoreDir(self, name):
134 return (super(CppLintProcessor, self).IgnoreDir(name) 134 return (super(CppLintProcessor, self).IgnoreDir(name)
135 or (name == 'third_party')) 135 or (name == 'third_party'))
136 136
137 IGNORE_LINT = ['flag-definitions.h']
138
139 def IgnoreFile(self, name):
140 return (super(CppLintProcessor, self).IgnoreFile(name)
141 or (name in CppLintProcessor.IGNORE_LINT))
142
137 def GetPathsToSearch(self): 143 def GetPathsToSearch(self):
138 return ['src', 'public', 'samples', join('test', 'cctest')] 144 return ['src', 'public', 'samples', join('test', 'cctest')]
139 145
140 def ProcessFiles(self, files): 146 def ProcessFiles(self, files):
141 filt = '-,' + ",".join(['+' + n for n in ENABLED_LINT_RULES]) 147 filt = '-,' + ",".join(['+' + n for n in ENABLED_LINT_RULES])
142 command = ['cpplint.py', '--filter', filt] + join(files) 148 command = ['cpplint.py', '--filter', filt] + join(files)
143 process = subprocess.Popen(command) 149 process = subprocess.Popen(command)
144 return process.wait() == 0 150 return process.wait() == 0
145 151
146 152
(...skipping 14 matching lines...) Expand all
161 return False 167 return False
162 168
163 def GetPathsToSearch(self): 169 def GetPathsToSearch(self):
164 return ['.'] 170 return ['.']
165 171
166 def IgnoreDir(self, name): 172 def IgnoreDir(self, name):
167 return (super(SourceProcessor, self).IgnoreDir(name) 173 return (super(SourceProcessor, self).IgnoreDir(name)
168 or (name == 'third_party') 174 or (name == 'third_party')
169 or (name == 'obj')) 175 or (name == 'obj'))
170 176
171 IGNORE_COPYRIGHTS = ['earley-boyer.js', 'raytrace.js', 'crypto.js'] 177 IGNORE_COPYRIGHTS = ['earley-boyer.js', 'raytrace.js', 'crypto.js',
178 'libraries.cc', 'libraries-empty.cc']
172 IGNORE_TABS = IGNORE_COPYRIGHTS + ['unicode-test.js', 179 IGNORE_TABS = IGNORE_COPYRIGHTS + ['unicode-test.js',
173 'html-comments.js'] 180 'html-comments.js']
174 181
175 def ProcessContents(self, name, contents): 182 def ProcessContents(self, name, contents):
176 result = True 183 result = True
177 base = basename(name) 184 base = basename(name)
178 if not base in SourceProcessor.IGNORE_TABS: 185 if not base in SourceProcessor.IGNORE_TABS:
179 if '\t' in contents: 186 if '\t' in contents:
180 print "%s contains tabs" % name 187 print "%s contains tabs" % name
181 result = False 188 result = False
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 success = CppLintProcessor().Run(workspace) and success 220 success = CppLintProcessor().Run(workspace) and success
214 success = SourceProcessor().Run(workspace) and success 221 success = SourceProcessor().Run(workspace) and success
215 if success: 222 if success:
216 return 0 223 return 0
217 else: 224 else:
218 return 1 225 return 1
219 226
220 227
221 if __name__ == '__main__': 228 if __name__ == '__main__':
222 sys.exit(Main()) 229 sys.exit(Main())
OLDNEW
« no previous file with comments | « src/flags.defs ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698