#2706 - Local privates to search_privates.py

This commit is contained in:
PabstMirror 2015-10-12 16:14:35 -05:00
parent 1242cc8349
commit d091fcbdbc

View File

@ -16,7 +16,7 @@ def get_private_declare(content):
priv_dec_str = ''.join(priv_srch_declared) priv_dec_str = ''.join(priv_srch_declared)
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z]*?)[ ,\}\]\)";]') srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z0-9]*?)[ ,\}\]\)";]')
priv_split = srch.findall(priv_dec_str) priv_split = srch.findall(priv_dec_str)
priv_split = sorted(set(priv_split)) priv_split = sorted(set(priv_split))
priv_declared += priv_split; priv_declared += priv_split;
@ -27,12 +27,18 @@ def get_private_declare(content):
priv_dec_str = ''.join(priv_srch_declared) priv_dec_str = ''.join(priv_srch_declared)
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z]*?)[ ,\}\]\)";]') srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z0-9]*?)[ ,\}\]\)";]')
priv_split = srch.findall(priv_dec_str) priv_split = srch.findall(priv_dec_str)
priv_split = sorted(set(priv_split)) priv_split = sorted(set(priv_split))
priv_declared += priv_split; priv_declared += priv_split;
srch = re.compile('(?i)[\s]*local[\s]+(_[\w\d]*)[\s]*=.*')
priv_local = srch.findall(content)
priv_local_declared = sorted(set(priv_local))
priv_declared += priv_local_declared;
return priv_declared return priv_declared
@ -53,7 +59,7 @@ def check_privates(filepath):
# Regex search privates # Regex search privates
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z]*?)[ ,\^\-\+\/\*\%\}\]\)";]') srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z0-9]*?)[ =,\^\-\+\/\*\%\}\]\)";]')
priv_use = srch.findall(content) priv_use = srch.findall(content)
priv_use = sorted(set(priv_use)) priv_use = sorted(set(priv_use))