MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / adjust_copyright_year

Function adjust_copyright_year

scripts/format_code.py:43–59  ·  view source on GitHub ↗
(copyright_years, curr_year)

Source from the content-addressed store, hash-verified

41skip_copyright_global = False
42
43def adjust_copyright_year(copyright_years, curr_year):
44 ret_copyright_year = str()
45 # Read last year in the Copyright
46 last_year = int(copyright_years[-4:])
47 if last_year == curr_year:
48 ret_copyright_year = copyright_years
49 elif last_year == (curr_year - 1):
50 # Create range if latest year on the copyright is the previous
51 if len(copyright_years) > 4 and copyright_years[-5] == "-":
52 # Range already exists, update year to current
53 ret_copyright_year = copyright_years[:-5] + "-" + str(curr_year)
54 else:
55 # Create a new range
56 ret_copyright_year = copyright_years + "-" + str(curr_year)
57 else:
58 ret_copyright_year = copyright_years + ", " + str(curr_year)
59 return ret_copyright_year
60
61def check_copyright( filename ):
62 f = open(filename, "r")

Callers 1

check_copyrightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected