diff --git a/noxfile.py b/noxfile.py index e083aa7..184e1b5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,6 +2,8 @@ Nox provides the following tasks: +- "init-project": install the pre-commit hooks + - "fix-branch-references": adjusts links with git branch references in various files (e.g., Mardown or notebooks) @@ -28,6 +30,16 @@ nox.options.envdir = ".cache/nox" nox.options.error_on_external_run = True +@nox.session(name="init-project", venv_backend="none") +def init_project(session): + """Install the pre-commit hooks.""" + for type_ in ( + "pre-commit", + "pre-merge-commit", + ): + session.run("poetry", "run", "pre-commit", "install", f"--hook-type={type_}") + + @nox.session(name="fix-branch-references", venv_backend="none") def fix_branch_references(_session): """Change git branch references.