MCPcopy Index your code
hub / github.com/cpplint/cpplint / CheckForCopyright

Function CheckForCopyright

cpplint.py:2435–2451  ·  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

2433
2434
2435def CheckForCopyright(filename, lines, error):
2436 """Logs an error if no Copyright message appears at the top of the file."""
2437
2438 # We'll say it should occur by line 10. Don't forget there's a
2439 # placeholder line at the front.
2440 for line in range(1, min(len(lines), 11)):
2441 if re.search(r"Copyright", lines[line], re.IGNORECASE):
2442 break
2443 else: # means no copyright line was found
2444 error(
2445 filename,
2446 0,
2447 "legal/copyright",
2448 5,
2449 "No copyright message found. "
2450 'You should have a line: "Copyright [year] <Copyright Owner>"',
2451 )
2452
2453
2454def GetIndentLevel(line):

Callers 1

ProcessFileDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected