22from tempfile import NamedTemporaryFile
33
44import nox
5- from nox import parametrize
5+ from nox import param , parametrize
66from nox_poetry import Session , session
77
88nox .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)
5053def 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)
6265def lint (s : Session , command : list [str ]) -> None :
0 commit comments