summaryrefslogtreecommitdiff
path: root/rule_checker.py
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2017-03-16 20:16:48 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2017-03-16 20:16:48 +0900
commit3776430fde297f2466112a1aa0f8fa237c476316 (patch)
tree1ffb760f72993242de44d923c8e05453269ffdc1 /rule_checker.py
parent54897f5db684ccba55fd9f54e6289a982a100e8b (diff)
downloadbuilding-blocks-3776430fde297f2466112a1aa0f8fa237c476316.tar.gz
building-blocks-3776430fde297f2466112a1aa0f8fa237c476316.tar.bz2
building-blocks-3776430fde297f2466112a1aa0f8fa237c476316.zip
RULE: prevent hacking with non .inc files
Change-Id: I751927f469d9c262fb9cd6dbe6404728358f305d Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'rule_checker.py')
-rwxr-xr-xrule_checker.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/rule_checker.py b/rule_checker.py
index 7368701..5e7be0a 100755
--- a/rule_checker.py
+++ b/rule_checker.py
@@ -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]