-
Notifications
You must be signed in to change notification settings - Fork 19
/
noxfile.py
41 lines (29 loc) · 820 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
37
38
39
40
41
"""Configure nox."""
import nox
NOX_SESSION = nox.session(python=False)
@NOX_SESSION
def fix(session: nox.Session):
"""Fix files inplace."""
session.run("ruff", "format", "-s", ".")
session.run("ruff", "check", "-se", "--fix", ".")
@NOX_SESSION
def lint(session: nox.Session):
"""Check file formatting that only have to do with formatting."""
session.run("ruff", "format", "--check", ".")
session.run("ruff", "check", ".")
@NOX_SESSION
def typecheck(session: nox.Session):
session.run("mypy", "toml_sort")
@NOX_SESSION
def tests(session: nox.Session):
session.run("pytest", "tests")
@NOX_SESSION
def coverage(session: nox.Session):
session.run(
"pytest",
"--cov",
"toml_sort",
"--cov-report",
"term-missing",
"tests",
)