Logs an error if no Copyright message appears at the top of the file.
(filename, lines, error)
| 2246 | |
| 2247 | |
| 2248 | def CheckForCopyright(filename, lines, error): |
| 2249 | """Logs an error if no Copyright message appears at the top of the file.""" |
| 2250 | |
| 2251 | # We'll say it should occur by line 10. Don't forget there's a |
| 2252 | # dummy line at the front. |
| 2253 | for line in xrange(1, min(len(lines), 11)): |
| 2254 | if re.search(r'Copyright', lines[line], re.I): break |
| 2255 | else: # means no copyright line was found |
| 2256 | error(filename, 0, 'legal/copyright', 5, |
| 2257 | 'No copyright message found. ' |
| 2258 | 'You should have a line: "Copyright [year] <Copyright Owner>"') |
| 2259 | |
| 2260 | |
| 2261 | def GetIndentLevel(line): |