RULE: prevent hacking with non .inc files 48/119348/1
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 16 Mar 2017 11:16:48 +0000 (20:16 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 16 Mar 2017 11:16:48 +0000 (20:16 +0900)
Change-Id: I751927f469d9c262fb9cd6dbe6404728358f305d
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
rule_checker.py

index 7368701..5e7be0a 100755 (executable)
@@ -306,10 +306,16 @@ def main():
 
     # iterate in the list of ./packaging/
     for file in dirs:
-        if re.search('\.inc', file):
+        if re.search(r'\.inc', file):
            result = ruleCheckInc(file)
            error += result[0]
            warning += result[1]
+       elif re.search(r'^\..*\.sw.', file):
+           # skip if it is vi swap file
+           print("There is a garbage in packaging. But let's skip (next version should check git status")
+       elif not file == 'building-blocks.spec':
+           print("Please do not put garbage files in packaging/ directory: "+file)
+           error += 1
 
     result = ruleCheckInterBlock()
     error += result[0]