Install all hook types with a plain pre-commit install

This commit is contained in:
Alexander Hess 2026-11-27 14:59:25 +01:00
commit 08dd3b8218
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
2 changed files with 3 additions and 2 deletions

View file

@ -1,3 +1,4 @@
default_install_hook_types: [pre-commit, pre-merge-commit] # used by a plain `pre-commit install`
default_stages: [pre-commit] # only used if a hook does not specify stages
fail_fast: true
repos:

View file

@ -444,8 +444,8 @@ def check_dependency_upgrades(session: Session) -> None:
@nox.session(name='init-project', python=MAIN_PYTHON, venv_backend='none')
def initialize_project(session: Session) -> None:
"""Install the `pre-commit` hooks."""
for type_ in ('pre-commit', 'pre-merge-commit', 'pre-push'):
session.run('uv', 'run', 'pre-commit', 'install', f'--hook-type={type_}')
# .pre-commit-config.yaml sets the hook types via "default_install_hook_types"
session.run('uv', 'run', 'pre-commit', 'install')
@nox.session(name='clean-cwd', python=MAIN_PYTHON, venv_backend='none')