How to use the autohooks.terminal.warning function in autohooks

To help you get started, we’ve selected a few autohooks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github greenbone / autohooks / autohooks / precommit / run.py View on Github external
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 '
github greenbone / autohooks / autohooks / precommit / run.py View on Github external
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)
            )