feat: add homli custom logic.

This commit is contained in:
George Papaioannou 2023-12-13 13:58:25 +02:00
parent 03ef7f3f8d
commit 79799eabb0
2 changed files with 56 additions and 4 deletions

View file

@ -1,13 +1,26 @@
from __future__ import annotations
import sys
from pre_commit.homli.constants import DEFAULT_CONFIG_FILE
import importlib.metadata
if sys.version_info >= (3, 8): # pragma: >=3.8 cover
import importlib.metadata as importlib_metadata
else: # pragma: <3.8 cover
import importlib_metadata
CONFIG_FILE = '.pre-commit-config.yaml'
CONFIG_FILE = DEFAULT_CONFIG_FILE
MANIFEST_FILE = '.pre-commit-hooks.yaml'
# Bump when installation changes in a backwards / forwards incompatible way
INSTALLED_STATE_VERSION = '1'
# Bump when modifying `empty_template`
LOCAL_REPO_VERSION = '1'
VERSION = importlib.metadata.version('pre_commit')
VERSION = importlib_metadata.version('pre_commit')
# `manual` is not invoked by any installed git hook. See #719
STAGES = (
'commit', 'merge-commit', 'prepare-commit-msg', 'commit-msg',
'post-commit', 'manual', 'post-checkout', 'push', 'post-merge',
'post-rewrite',
)
DEFAULT = 'default'