Skip to content

Commit e788eae

Browse files
committed
lint for copyright
1 parent 72effc0 commit e788eae

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

scripts/cpp_lint.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@
445445
_error_suppressions = {}
446446

447447
# Finds Copyright.
448-
_RE_COPYRIGHT = re.compile(r'Copyright \d\d\d\d BVLC and contributors.')
448+
_RE_COPYRIGHT = re.compile(r'Copyright')
449449

450450
# The root directory used for deriving header guard CPP variable.
451451
# This is set by --root flag.
@@ -1368,16 +1368,15 @@ def ReverseCloseExpression(clean_lines, linenum, pos):
13681368

13691369

13701370
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."""
13721372

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
13741374
# dummy line at the front.
13751375
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.')
13811380

13821381

13831382
def GetHeaderGuardCPPVariable(filename):

0 commit comments

Comments
 (0)