MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / check

Function check

tools/ci/file_check.py:264–288  ·  view source on GitHub ↗

check files license and format.

(check_license, repo, branch)

Source from the content-addressed store, hash-verified

262 default='master',
263)
264def check(check_license, repo, branch):
265 """
266 check files license and format.
267 """
268 init_logger()
269 # get modified files list
270 checkout = CheckOut(repo, branch)
271 file_list = checkout.get_new_file()
272 if file_list is None:
273 logging.error("checkout files fail")
274 sys.exit(1)
275
276 # check modified files format
277 format_check = FormatCheck(file_list)
278 format_check_result = format_check.check()
279 license_check_result = True
280 if check_license:
281 license_check = LicenseCheck(file_list)
282 license_check_result = license_check.check()
283
284 if not format_check_result or not license_check_result:
285 logging.error("file format check or license check fail.")
286 sys.exit(1)
287 logging.info("check success.")
288 sys.exit(0)
289
290
291if __name__ == '__main__':

Callers

nothing calls this directly

Calls 7

get_new_fileMethod · 0.95
checkMethod · 0.95
checkMethod · 0.95
FormatCheckClass · 0.85
LicenseCheckClass · 0.85
init_loggerFunction · 0.70
CheckOutClass · 0.70

Tested by

no test coverage detected