MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / CheckForCopyright

Function CheckForCopyright

src/tests/coding/cpplint.py:2233–2243  ·  view source on GitHub ↗

Logs an error if no Copyright message appears at the top of the file.

(filename, lines, error)

Source from the content-addressed store, hash-verified

2231
2232
2233def 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
2246def GetIndentLevel(line):

Callers 1

ProcessFileDataFunction · 0.85

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected