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

Side by Side Diff: tools/sanitize_source_files.py

Issue 23981006: Ignore the .git directory in sanitize_source_files, remove .git directory... (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | « no previous file | 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Module that sanitizes source files with specified modifiers.""" 6 """Module that sanitizes source files with specified modifiers."""
7 7
8 8
9 import commands 9 import commands
10 import os 10 import os
11 import sys 11 import sys
12 12
13 13
14 _FILE_EXTENSIONS_TO_SANITIZE = ['cpp', 'h', 'c', 'gyp', 'gypi'] 14 _FILE_EXTENSIONS_TO_SANITIZE = ['cpp', 'h', 'c', 'gyp', 'gypi']
15 15
16 _SUBDIRS_TO_IGNORE = ['.svn', 'third_party'] 16 _SUBDIRS_TO_IGNORE = ['.git', '.svn', 'third_party']
17 17
18 18
19 def SanitizeFilesWithModifiers(directory, file_modifiers, line_modifiers): 19 def SanitizeFilesWithModifiers(directory, file_modifiers, line_modifiers):
20 """Sanitizes source files with the specified file and line modifiers. 20 """Sanitizes source files with the specified file and line modifiers.
21 21
22 Args: 22 Args:
23 directory: string - The directory which will be recursively traversed to 23 directory: string - The directory which will be recursively traversed to
24 find source files to apply modifiers to. 24 find source files to apply modifiers to.
25 file_modifiers: list - file-modification methods which should be applied to 25 file_modifiers: list - file-modification methods which should be applied to
26 the complete file content (Eg: EOFOneAndOnlyOneNewlineAdder). 26 the complete file content (Eg: EOFOneAndOnlyOneNewlineAdder).
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 CopywriteChecker, 143 CopywriteChecker,
144 EOFOneAndOnlyOneNewlineAdder, 144 EOFOneAndOnlyOneNewlineAdder,
145 SvnEOLChecker, 145 SvnEOLChecker,
146 ], 146 ],
147 line_modifiers=[ 147 line_modifiers=[
148 CrlfReplacer, 148 CrlfReplacer,
149 TabReplacer, 149 TabReplacer,
150 TrailingWhitespaceRemover, 150 TrailingWhitespaceRemover,
151 ], 151 ],
152 )) 152 ))
OLDNEW
« 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