[fix] don't take comments into account

This commit is contained in:
Laurent Peuch 2016-12-23 18:06:44 +01:00
parent 9c2aec8746
commit ef437e255e

View file

@ -2,6 +2,7 @@
import sys import sys
import os import os
import re
import json import json
@ -53,7 +54,8 @@ def check_file_exist(file_path):
def read_file(file_path): def read_file(file_path):
with open(file_path) as f: with open(file_path) as f:
file = f.read().splitlines() # remove every comments from the file content to avoid false positives
file = re.sub("#.*[^\n]", "", f.read()).splitlines()
return file return file