Logs an error if no Copyright message appears at the top of the file.
(filename, lines, error)
| 1620 | |
| 1621 | |
| 1622 | def CheckForCopyright(filename, lines, error): |
| 1623 | """Logs an error if no Copyright message appears at the top of the file.""" |
| 1624 | |
| 1625 | # We'll say it should occur by line 10. Don't forget there's a |
| 1626 | # dummy line at the front. |
| 1627 | for line in xrange(1, min(len(lines), 11)): |
| 1628 | if re.search(r'Copyright', lines[line], re.I): break |
| 1629 | else: # means no copyright line was found |
| 1630 | error(filename, 0, 'legal/copyright', 5, |
| 1631 | 'No copyright message found. ' |
| 1632 | 'You should have a line: "Copyright [year] <Copyright Owner>"') |
| 1633 | |
| 1634 | |
| 1635 | def GetIndentLevel(line): |
no test coverage detected