MCPcopy Index your code
hub / github.com/nodejs/node / CheckForCopyright

Function CheckForCopyright

tools/cpplint.py:2480–2496  ·  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

2478
2479
2480def CheckForCopyright(filename, lines, error):
2481 """Logs an error if no Copyright message appears at the top of the file."""
2482
2483 # We'll say it should occur by line 10. Don't forget there's a
2484 # placeholder line at the front.
2485 for line in range(1, min(len(lines), 11)):
2486 if re.search(r"Copyright", lines[line], re.IGNORECASE):
2487 break
2488 else: # means no copyright line was found
2489 error(
2490 filename,
2491 0,
2492 "legal/copyright",
2493 5,
2494 "No copyright message found. "
2495 'You should have a line: "Copyright [year] <Copyright Owner>"',
2496 )
2497
2498
2499def GetIndentLevel(line):

Callers 1

ProcessFileDataFunction · 0.85

Calls 4

minFunction · 0.85
rangeFunction · 0.50
errorFunction · 0.50
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…