-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnoxfile.py
54 lines (44 loc) · 1.31 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
import nox
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ["tests", "cover", "lint"]
@nox.session
def tests(session):
session.install("poetry")
session.install("pytest-cov")
session.run("poetry", "install")
session.run("poetry", "check")
session.run("poetry", "run", "pytest", "-vv", "--cov=options_reticle")
session.notify("cover")
@nox.session
def cover(session):
session.install("coverage")
session.run("coverage", "report", "--show-missing", "--fail-under=50")
session.run("coverage", "erase")
lint_files = [
"__init__.py",
"builder.py",
"core.py",
"downloader.py",
"emoji.py",
"options.py",
"paths.py",
"tradingview.py",
]
@nox.session
def lint(session):
session.install(
"black",
"flake8",
"flake8-import-order",
"flake8-bugbear",
"flake8-docstrings",
"flake8-annotations",
"pylint",
"codespell",
)
for file_name in lint_files:
file_path = f"options_reticle/{file_name}"
session.run("black", "--line-length", "99", "--check", "--quiet", file_path)
session.run("flake8", "--import-order-style", "google", file_path)
session.run("pylint", "--disable=E0401,R0903,W0511", file_path)
session.run("codespell", file_path)