Skip to content

Commit d2c451c

Browse files
feat: Add get_path
1 parent 2f2e13a commit d2c451c

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

noxfile.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,30 @@
44
"""
55
Nox configuration file.
66
"""
7+
import os
8+
79
import nox
810

11+
12+
def get_path(*path):
13+
"""
14+
Return the absolute path of the given path.
15+
"""
16+
return os.path.join(NOX_DIR, *path)
17+
18+
19+
NOX_DIR = os.path.abspath(os.path.dirname(__file__))
20+
21+
922
LINT_DEPENDENCIES = [
1023
"isort",
1124
"black",
1225
"flake8",
1326
]
27+
1428
LINT_PATH = [
15-
"test",
29+
get_path("noxfile.py"),
30+
get_path("test"),
1631
]
1732

1833

@@ -24,7 +39,7 @@ def isort(session):
2439
"isort",
2540
"--profile",
2641
"black",
27-
".",
42+
*LINT_PATH,
2843
)
2944

3045

@@ -37,7 +52,7 @@ def blacken(session):
3752
session.run(
3853
"black",
3954
"--check",
40-
".",
55+
*LINT_PATH,
4156
)
4257

4358

@@ -47,7 +62,7 @@ def flake(session):
4762
session.install("flake8")
4863
session.run(
4964
"flake8",
50-
".",
65+
*LINT_PATH,
5166
)
5267

5368

0 commit comments

Comments
 (0)