-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
36 lines (31 loc) · 845 Bytes
/
noxfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import nox
PYTHON_VERSION = "3.10.12"
POETRY_VERSION = "1.6.1"
@nox.session(reuse_venv=True, python=PYTHON_VERSION)
def hooks(session: nox.Session) -> None:
"""
Run all the pre-commit hooks in all the files.
Parameters
----------
session : nox.Session
The nox session
Returns
-------
None
"""
session.install(f"poetry=={POETRY_VERSION}")
session.run("poetry", "install", "--no-interaction", "--with", "dev")
session.run("poetry", "run", "pre-commit", "install", "--install-hooks")
session.run(
"poetry", "run", "dbt", "deps", "--project-dir", "dbt", "--profiles-dir", "dbt"
)
session.run(
"poetry",
"run",
"pre-commit",
"run",
"--hook-stage",
"commit",
"--show-diff-on-failure",
"--all-files",
)