def main(commit_only=True):
global TEMP_FOLDER<EOL>exit_code = <NUM_LIT:0><EOL>hook_checks = HookConfig(get_config_file())<EOL>with files_to_check(commit_only) as files:<EOL><INDENT>for name, mod in checks():<EOL><INDENT>default = getattr(mod, '<STR_LIT>', '<STR_LIT>')<EOL>if hook_checks.is_enabled(name, default=default):<EOL><INDENT>if hasattr(mod, '<STR_LIT>'):<EOL><INDENT>for filename in mod.REQUIRED_FILES:<EOL><INDENT>if os.path.isfile(filename):<EOL><INDENT>try:<EOL><INDENT>shutil.copy(filename, TEMP_FOLDER)<EOL><DEDENT>except shutil.Error:<EOL><INDENT>continue<EOL><DEDENT><DEDENT><DEDENT><DEDENT>args = hook_checks.arguments(name)<EOL>tmp_files = [os.path.join(TEMP_FOLDER, f) for f in files]<EOL>if args:<EOL><INDENT>errors = mod.run(tmp_files, TEMP_FOLDER, args)<EOL><DEDENT>else:<EOL><INDENT>errors = mod.run(tmp_files, TEMP_FOLDER)<EOL><DEDENT>if errors:<EOL><INDENT>title_print("<STR_LIT>".format(name))<EOL>print((errors.replace(TEMP_FOLDER + "<STR_LIT:/>", '<STR_LIT>')))<EOL>print("<STR_LIT>")<EOL>exit_code = <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT><DEDENT>if exit_code == <NUM_LIT:1>:<EOL><INDENT>title_print("<STR_LIT>")<EOL><DEDENT>return exit_code<EOL>
Run the configured code checks.

Return system exit code.
    1 - reject commit
    0 - accept commit