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

Unified Diff: tools/refactoring/trimall.py

Issue 1581573003: Remove tools/refactoring. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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 | « tools/refactoring/trim.py ('k') | tools/refactoring/webrtc_reformat.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/refactoring/trimall.py
diff --git a/tools/refactoring/trimall.py b/tools/refactoring/trimall.py
deleted file mode 100644
index 7a1c458af3fd4d8867d77a3d56f16403545059d4..0000000000000000000000000000000000000000
--- a/tools/refactoring/trimall.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import fileinput
-import filemanagement
-import p4commands
-
-# Defaults
-TABSIZE = 4
-
-extensions = ['.h','.cc','.c','.cpp']
-
-ignore_these = ['my_ignore_header.h']
-
-usage = """
-Replaces all TAB characters with %(TABSIZE)d space characters.
-In addition, all trailing space characters are removed.
-usage: trim directory
-""" % vars()
-
-if((len(sys.argv) != 2) and (len(sys.argv) != 3)):
- sys.stderr.write(usage)
- sys.exit(2)
-
-directory = sys.argv[1];
-if(not filemanagement.pathexist(directory)):
- sys.stderr.write(usage)
- sys.exit(2)
-
-if((len(sys.argv) == 3) and (sys.argv[2] != '--commit')):
- sys.stderr.write(usage)
- sys.exit(2)
-
-commit = False
-if(len(sys.argv) == 3):
- commit = True
-
-files_to_fix = []
-for extension in extensions:
- files_to_fix.extend(filemanagement.listallfilesinfolder(directory,\
- extension))
-
-def main():
- if (commit):
- p4commands.checkoutallfiles()
- for path,file_name in files_to_fix:
- full_file_name = path + file_name
- if (not commit):
- print full_file_name + ' will be edited'
- continue
- for line in fileinput.input(full_file_name, inplace=True):
- line = line.replace('\t',' '*TABSIZE); # replace TABs
- line = line.rstrip(None) # remove trailing whitespaces
- print line # modify the file
- if (commit):
- p4commands.revertunchangedfiles()
-
-if __name__ == '__main__':
- main()
« no previous file with comments | « tools/refactoring/trim.py ('k') | tools/refactoring/webrtc_reformat.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698