Skip to content

Commit 60c5091

Browse files
committed
Fix up linter script to accept new Copyright label
1 parent fa1d8e2 commit 60c5091

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

scripts/cpplint.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,14 +1920,11 @@ def ReverseCloseExpression(clean_lines, linenum, pos):
19201920
def CheckForCopyright(filename, lines, error):
19211921
"""Logs an error if no Copyright message appears at the top of the file."""
19221922

1923-
# We'll say it should occur by line 10. Don't forget there's a
1924-
# dummy line at the front.
1925-
for line in xrange(1, min(len(lines), 11)):
1926-
if re.search(r'Author', lines[line], re.I): break
1927-
else: # means no copyright line was found
1923+
# Line one should contain the word 'Copyright' somewhere
1924+
if not re.search(r'Copyright', lines[1], re.I):
19281925
error(filename, 0, 'legal/copyright', 5,
19291926
'No copyright message found. '
1930-
'You should have a line: "Author: <name>"')
1927+
'You should use the standard copyright block.')
19311928

19321929

19331930
def GetIndentLevel(line):

0 commit comments

Comments
 (0)