Logs an error if no Copyright message appears at the top of the file.
(filename, lines, error)
| 1759 | |
| 1760 | |
| 1761 | def CheckForCopyright(filename, lines, error): |
| 1762 | """Logs an error if no Copyright message appears at the top of the file.""" |
| 1763 | |
| 1764 | # We'll say it should occur by line 10. Don't forget there's a |
| 1765 | # dummy line at the front. |
| 1766 | for line in xrange(1, min(len(lines), 11)): |
| 1767 | if re.search(r'Copyright', lines[line], re.I): break |
| 1768 | else: # means no copyright line was found |
| 1769 | error(filename, 0, 'legal/copyright', 5, |
| 1770 | 'No copyright message found. ' |
| 1771 | 'You should have a line: "Copyright [year] <Copyright Owner>"') |
| 1772 | |
| 1773 | |
| 1774 | def GetIndentLevel(line): |
no test coverage detected