-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
38 lines (31 loc) · 970 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
import nox
from nox.sessions import Session
locations = "pyfilemovr", "run.py", "noxfile.py"
python_versions = ["3.9"]
nox.options.sessions = "lint", "mypy"
@nox.session(python=python_versions)
def lint(session: Session) -> None:
"""Lint code using flake8."""
args = session.posargs or locations
session.install(
"flake8",
"flake8-annotations",
"flake8-bandit",
"flake8-black",
"flake8-bugbear",
"flake8-docstrings",
"flake8-import-order",
)
session.run("flake8", *args)
@nox.session(python=python_versions)
def black(session: Session) -> None:
"""Format code using black."""
args = session.posargs or locations
session.install("black")
session.run("black", *args)
@nox.session(python=python_versions)
def mypy(session: Session) -> None:
"""Check typing with mypy."""
args = session.posargs or locations
session.install("mypy")
session.run("mypy", *args)