summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEvan Shelhamer <shelhamer@imaginarynumber.net>2014-08-06 00:36:00 -0700
committerEvan Shelhamer <shelhamer@imaginarynumber.net>2014-08-06 18:35:29 -0700
commite788eae37e746c512a5618c673b04eacaa3fff6a (patch)
tree8b4b144dbf007591fc215c67fe30f57b34d95869 /scripts
parent72effc037f60c4acdbc2f172064fc6bef6820009 (diff)
downloadcaffeonacl-e788eae37e746c512a5618c673b04eacaa3fff6a.tar.gz
caffeonacl-e788eae37e746c512a5618c673b04eacaa3fff6a.tar.bz2
caffeonacl-e788eae37e746c512a5618c673b04eacaa3fff6a.zip
lint for copyright
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cpp_lint.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/cpp_lint.py b/scripts/cpp_lint.py
index 3f0ca1c3..3f80e723 100755
--- a/scripts/cpp_lint.py
+++ b/scripts/cpp_lint.py
@@ -445,7 +445,7 @@ _RE_SUPPRESSION = re.compile(r'\bNOLINT(_NEXT_LINE)?\b(\([^)]*\))?')
_error_suppressions = {}
# Finds Copyright.
-_RE_COPYRIGHT = re.compile(r'Copyright \d\d\d\d BVLC and contributors.')
+_RE_COPYRIGHT = re.compile(r'Copyright')
# The root directory used for deriving header guard CPP variable.
# This is set by --root flag.
@@ -1368,16 +1368,15 @@ def ReverseCloseExpression(clean_lines, linenum, pos):
def CheckForCopyright(filename, lines, error):
- """Logs an error if no Copyright message appears at the top of the file."""
+ """Logs an error if a Copyright message appears at the top of the file."""
- # We'll say it should occur by line 10. Don't forget there's a
+ # We'll check up to line 10. Don't forget there's a
# dummy line at the front.
for line in xrange(1, min(len(lines), 11)):
- if _RE_COPYRIGHT.search(lines[line], re.I): break
- else: # means no copyright line was found
- error(filename, 0, 'legal/copyright', 5,
- 'BVLC copyright message not found. '
- 'You should have a line: "Copyright [year] BVLC and contributors."')
+ if _RE_COPYRIGHT.search(lines[line], re.I):
+ error(filename, 0, 'legal/copyright', 5,
+ 'Copyright message found. '
+ 'You should not include a copyright line.')
def GetHeaderGuardCPPVariable(filename):