MCPcopy Create free account
hub / github.com/alibaba/GraphScope / CheckForCopyright

Function CheckForCopyright

analytical_engine/misc/cpplint.py:2237–2247  ·  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

2235
2236
2237def CheckForCopyright(filename, lines, error):
2238 """Logs an error if no Copyright message appears at the top of the file."""
2239
2240 # We'll say it should occur by line 10. Don't forget there's a
2241 # placeholder line at the front.
2242 for line in xrange(1, min(len(lines), 11)):
2243 if re.search(r'Copyright', lines[line], re.I): break
2244 else: # means no copyright line was found
2245 error(filename, 0, 'legal/copyright', 5,
2246 'No copyright message found. '
2247 'You should have a line: "Copyright [year] <Copyright Owner>"')
2248
2249
2250def GetIndentLevel(line):

Callers 1

ProcessFileDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected