Standardize whitespace between functions

Reported as E305 and E305 by pycodestyle

Signed-off-by: nickthetait <nicholas.tait@ieee.org>
This commit is contained in:
nickthetait 2018-03-14 00:54:25 -06:00
parent aeac180dbb
commit 7e5531da5b
1 changed files with 9 additions and 0 deletions

View File

@ -315,10 +315,12 @@ def htmlize(s):
# Take s, and return legal (UTF-8) HTML.
return s.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
def h(s):
# htmlize s if we're generating html, otherwise just return s.
return htmlize(s) if output_format else s
def print_multi_line(text):
# Print text as multiple indented lines.
width = 78
@ -337,6 +339,7 @@ def print_multi_line(text):
print(w, end='')
position = position + len(w) + 1
# This matches references to CWE identifiers, so we can HTMLize them.
# We don't refer to CWEs with one digit, so we'll only match on 2+ digits.
link_cwe_pattern = re.compile(r'(CWE-([1-9][0-9]+))([,()!/])')
@ -607,6 +610,7 @@ def c_singleton_string(text):
"Returns true if text is a C string with 0 or 1 character."
return 1 if p_c_singleton_string.search(text) else 0
# This string defines a C constant.
p_c_constant_string = re.compile(r'^\s*L?"([^\\]|\\[^0-6]|\\[0-6]+)*"$')
@ -826,9 +830,11 @@ def cpp_unsafe_stl(hit):
if len(hit.parameters) <= 4:
add_warning(hit)
def normal(hit):
add_warning(hit)
# "c_ruleset": the rules for identifying "hits" in C (potential warnings).
# It's a dictionary, where the key is the function name causing the hit,
# and the value is a tuple with the following format:
@ -2020,10 +2026,12 @@ def process_files():
process_file_args(files, patch_infos)
return True
def hitlist_sort_key(hit):
"""Sort key for hitlist."""
return (-hit.level, hit.filename, hit.line, hit.column, hit.name)
def show_final_results():
global hitlist
global error_level_exceeded
@ -2183,6 +2191,7 @@ def flawfind():
save_if_desired()
return 1 if error_level_exceeded else 0
if __name__ == '__main__':
try:
sys.exit(flawfind())