in scancode/scanCode.py [0:0]
def no_trailing_spaces(line):
"""Assert line does not have trailing whitespace."""
if len(line) > 0 and line[-1] == '\n':
line = line[:-1]
if re.match("""^.*\s$""", line):
return ERR_TRAILING_WHITESPACE
else:
return None