forked from kirillsulim/gitsnapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
48 lines (40 loc) · 973 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
42
43
44
45
46
47
48
from pathlib import Path
import nox
LINE_LENGTH = 120
FLAKE8_IGNORE = [
"E203",
"E231",
"W503",
]
@nox.session
def tests(session):
session.install(".")
session.install("pytest")
session.run("pytest", "tests.py")
@nox.session
def lint(session):
session.install("flake8", "black", "isort")
source_files = list(map(str, Path(".").glob("*.py")))
session.run("black", "--target-version", "py38", "--line-length", f"{LINE_LENGTH}", "--check", *source_files)
session.run(
"flake8",
"--max-line-length",
f"{LINE_LENGTH}",
"--extend-ignore",
",".join(FLAKE8_IGNORE),
"--show-source",
*source_files,
)
session.run(
"isort",
"--multi-line",
"3",
"--trailing-comma",
"--force-grid-wrap",
"0",
"--use-parentheses",
"--line-width",
f"{LINE_LENGTH}",
"--check-only",
*source_files,
)