MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / check_files

Function check_files

scripts/copyright.py:76–102  ·  view source on GitHub ↗
(check_files)

Source from the content-addressed store, hash-verified

74
75# Check the files for the presence of a valid year in the header
76def check_files(check_files):
77 queries, failures = query_files(check_files)
78
79 current_year = datetime.datetime.now().year
80
81 missing = []
82 outdated = {}
83
84 for filename, tokens in queries.items():
85 if not tokens:
86 missing.append(filename)
87 continue
88
89 outdated[filename] = None
90
91 for token in tokens:
92 copyright_years = re.findall(YEAR_PATTERN, token)
93
94 most_recent_year = int(copyright_years[-1]) if copyright_years else 0
95
96 if most_recent_year != current_year:
97 if not outdated[filename]:
98 outdated[filename] = []
99 outdated[filename].append(token)
100
101 outdated = {k: v for k, v in outdated.items() if v is not None}
102 return missing, outdated, failures
103
104def fix(file):
105 queries, failures = query_files([file])

Callers 1

copyright.pyFile · 0.85

Calls 1

query_filesFunction · 0.85

Tested by

no test coverage detected