Skip to content

Commit 04096bb

Browse files
authored
Add id names to parameterized nox commands (#253)
1 parent 3779ee4 commit 04096bb

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

noxfile.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from tempfile import NamedTemporaryFile
33

44
import nox
5-
from nox import parametrize
5+
from nox import param, parametrize
66
from nox_poetry import Session, session
77

88
nox.options.error_on_external_run = True
@@ -31,20 +31,23 @@ def test(s: Session) -> None:
3131
@parametrize(
3232
"command",
3333
[
34-
# During formatting, additionally sort imports and remove unused imports.
35-
[
36-
"ruff",
37-
"check",
38-
".",
39-
"--select",
40-
"I",
41-
"--select",
42-
"F401",
43-
"--extend-fixable",
44-
"F401",
45-
"--fix",
46-
],
47-
["ruff", "format", "."],
34+
param(
35+
[
36+
"ruff",
37+
"check",
38+
".",
39+
"--select",
40+
"I",
41+
# Also remove unused imports.
42+
"--select",
43+
"F401",
44+
"--extend-fixable",
45+
"F401",
46+
"--fix",
47+
],
48+
id="sort_imports",
49+
),
50+
param(["ruff", "format", "."], id="format"),
4851
],
4952
)
5053
def fmt(s: Session, command: list[str]) -> None:
@@ -55,8 +58,8 @@ def fmt(s: Session, command: list[str]) -> None:
5558
@parametrize(
5659
"command",
5760
[
58-
["ruff", "check", "."],
59-
["ruff", "format", "--check", "."],
61+
param(["ruff", "check", "."], id="lint_check"),
62+
param(["ruff", "format", "--check", "."], id="format_check"),
6063
],
6164
)
6265
def lint(s: Session, command: list[str]) -> None:

0 commit comments

Comments
 (0)