|
445 | 445 | _error_suppressions = {} |
446 | 446 |
|
447 | 447 | # Finds Copyright. |
448 | | -_RE_COPYRIGHT = re.compile(r'Copyright \d\d\d\d BVLC and contributors.') |
| 448 | +_RE_COPYRIGHT = re.compile(r'Copyright') |
449 | 449 |
|
450 | 450 | # The root directory used for deriving header guard CPP variable. |
451 | 451 | # This is set by --root flag. |
@@ -1368,16 +1368,15 @@ def ReverseCloseExpression(clean_lines, linenum, pos): |
1368 | 1368 |
|
1369 | 1369 |
|
1370 | 1370 | def CheckForCopyright(filename, lines, error): |
1371 | | - """Logs an error if no Copyright message appears at the top of the file.""" |
| 1371 | + """Logs an error if a Copyright message appears at the top of the file.""" |
1372 | 1372 |
|
1373 | | - # We'll say it should occur by line 10. Don't forget there's a |
| 1373 | + # We'll check up to line 10. Don't forget there's a |
1374 | 1374 | # dummy line at the front. |
1375 | 1375 | for line in xrange(1, min(len(lines), 11)): |
1376 | | - if _RE_COPYRIGHT.search(lines[line], re.I): break |
1377 | | - else: # means no copyright line was found |
1378 | | - error(filename, 0, 'legal/copyright', 5, |
1379 | | - 'BVLC copyright message not found. ' |
1380 | | - 'You should have a line: "Copyright [year] BVLC and contributors."') |
| 1376 | + if _RE_COPYRIGHT.search(lines[line], re.I): |
| 1377 | + error(filename, 0, 'legal/copyright', 5, |
| 1378 | + 'Copyright message found. ' |
| 1379 | + 'You should not include a copyright line.') |
1381 | 1380 |
|
1382 | 1381 |
|
1383 | 1382 | def GetHeaderGuardCPPVariable(filename): |
|
0 commit comments