Add init-project task
- add a nox session "init-project" + it installs the pre-commit hooks + being a task, the session is run in the develop environment
This commit is contained in:
parent
b2b29d9ec0
commit
b0a5b49664
1 changed files with 12 additions and 0 deletions
12
noxfile.py
12
noxfile.py
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
Nox provides the following tasks:
|
Nox provides the following tasks:
|
||||||
|
|
||||||
|
- "init-project": install the pre-commit hooks
|
||||||
|
|
||||||
- "fix-branch-references": adjusts links with git branch references in
|
- "fix-branch-references": adjusts links with git branch references in
|
||||||
various files (e.g., Mardown or notebooks)
|
various files (e.g., Mardown or notebooks)
|
||||||
|
|
||||||
|
@ -28,6 +30,16 @@ nox.options.envdir = ".cache/nox"
|
||||||
nox.options.error_on_external_run = True
|
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")
|
@nox.session(name="fix-branch-references", venv_backend="none")
|
||||||
def fix_branch_references(_session):
|
def fix_branch_references(_session):
|
||||||
"""Change git branch references.
|
"""Change git branch references.
|
||||||
|
|
Loading…
Reference in a new issue