Logs an error if no Copyright message appears at the top of the file.
(filename, lines, error)
| 2231 | |
| 2232 | |
| 2233 | def CheckForCopyright(filename, lines, error): |
| 2234 | """Logs an error if no Copyright message appears at the top of the file.""" |
| 2235 | |
| 2236 | # We'll say it should occur by line 10. Don't forget there's a |
| 2237 | # placeholder line at the front. |
| 2238 | for line in xrange(1, min(len(lines), 11)): |
| 2239 | if re.search(r'Copyright', lines[line], re.I): break |
| 2240 | else: # means no copyright line was found |
| 2241 | error(filename, 0, 'legal/copyright', 5, |
| 2242 | 'No copyright message found. ' |
| 2243 | 'You should have a line: "Copyright [year] <Copyright Owner>"') |
| 2244 | |
| 2245 | |
| 2246 | def GetIndentLevel(line): |
no test coverage detected