Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def check_hook_is_current(pre_commit_hook: PreCommitHook):
if not pre_commit_hook.is_current_autohooks_pre_commit_hook():
warning(
'autohooks pre-commit hook is outdated. Please run '
'\'autohooks activate --force\' to update your pre-commit '
def check_hook_mode(config_mode: Mode, hook_mode: Mode) -> None:
if config_mode != hook_mode:
warning(
'autohooks mode in pre-commit hook ("{}") differs from '
'mode in pyproject.toml file ("{}"). Please run \'autohooks '
'activate --force\' to enforce {} mode.'.format(
str(hook_mode), str(config_mode), str(config_mode)
)