summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-05-19 08:45:22 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-05-19 10:33:44 (GMT)
commite86a46545e23ad824d7013c3c57bd83a52ade9af (patch)
tree92c6bf7818f1ac0c6008289818a6237699c03b85 /BuildTools
parent55e0ca2aa1f2216121ecf17126caf8bdd4f3094b (diff)
downloadswift-e86a46545e23ad824d7013c3c57bd83a52ade9af.zip
swift-e86a46545e23ad824d7013c3c57bd83a52ade9af.tar.bz2
Enforce tab-only indentation in Python and SCons files
This also converts CheckTabs.py script to tab indentation. Test-Information: Ran the script over all files in our repo and it detected space and mixed indented Python files. Change-Id: Ifed86d64c8e87ed55e85ef4d35157e312b937291
Diffstat (limited to 'BuildTools')
-rwxr-xr-xBuildTools/CheckTabs.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/BuildTools/CheckTabs.py b/BuildTools/CheckTabs.py
index e007a68..e2029b0 100755
--- a/BuildTools/CheckTabs.py
+++ b/BuildTools/CheckTabs.py
@@ -5,27 +5,27 @@ import os, sys
foundExpandedTabs = False
filename = sys.argv[1]
-if (filename.endswith(".cpp") or filename.endswith(".h")) and not "3rdParty" in filename :
- file = open(filename, "r")
- contents = []
- contentsChanged = False
- for line in file.readlines() :
- newline = ""
- previousChar = None
- pastInitialSpace = False
- for char in line :
- if not pastInitialSpace :
- if char == ' ' and previousChar == ' ' :
- contentsChanged = True
- previousChar = '\t'
- continue
- pastInitialSpace = (char != ' ')
- if previousChar :
- newline += previousChar
- previousChar = char
- if previousChar :
- newline += previousChar
- contents.append(newline)
- file.close()
- if contentsChanged :
- sys.exit(-1)
+if (filename.endswith(".cpp") or filename.endswith(".h") or filename.endswith(".py") or filename.endswith("SConscript") or filename.endswith("SConscript.boot") or filename.endswith("SConstruct")) and not "3rdParty" in filename :
+ file = open(filename, "r")
+ contents = []
+ contentsChanged = False
+ for line in file.readlines() :
+ newline = ""
+ previousChar = None
+ pastInitialSpace = False
+ for char in line :
+ if not pastInitialSpace :
+ if char == ' ' and previousChar == ' ' :
+ contentsChanged = True
+ previousChar = '\t'
+ continue
+ pastInitialSpace = (char != ' ')
+ if previousChar :
+ newline += previousChar
+ previousChar = char
+ if previousChar :
+ newline += previousChar
+ contents.append(newline)
+ file.close()
+ if contentsChanged :
+ sys.exit(-1)