import typing


def filesDiffer(a:typing.List[str], b:typing.List[str]) -> bool:
	"""
	Compares two files for meaningingful differences. Traffic Ops Headers are
	stripped out of the file contents before comparison. Trailing whitespace
	is ignored

	:param a: The contents of the first file, as a list of its lines
	:param b: The contents of the second file, as a list of its lines
	:returns: :const:`True` if the files have any differences, :const:`False`
	"""
	a = [l.rstrip() for l in a if l.rstrip() and not l.startswith("# DO NOT EDIT") and\
	                                             not l.startswith("# TRAFFIC OPS NOTE:")]
	b = [l.rstrip() for l in b if l.rstrip() and not l.startswith("# DO NOT EDIT") and\
	                                             not l.startswith("# TRAFFIC OPS NOTE:")]

	if len(a) != len(b):
		return True

	for i, l in enumerate(a):
		if l != b[i]:
			return True

	return False