66import nox
77
88check_dirs = [
9- "benchmarks" ,
10- "docs" ,
11- "src" ,
12- "tests" ,
13- ]
9+ "benchmarks" ,
10+ "docs" ,
11+ "src" ,
12+ "tests" ,
13+ ]
14+
15+ check_files = [
16+ "noxfile.py" ,
17+ ]
18+
1419
1520@nox .session
1621def formatting (session : nox .Session ) -> None :
22+ """Run black and isort to make sure the format is uniform."""
1723 session .install ("black" , "isort" )
18- session .run ("black" , "--check" , * check_dirs )
19- session .run ("isort" , "--check" , * check_dirs )
24+ session .run ("black" , "--check" , * check_dirs , * check_files )
25+ session .run ("isort" , "--check" , * check_dirs , * check_files )
2026
2127
2228@nox .session
2329def pylint (session : nox .Session ) -> None :
24- session .install (".[docs]" , "pylint" , "pytest" )
25- session .run ("pylint" , * check_dirs )
30+ """Run pylint to do lint checks."""
31+ session .install ("-e" , ".[docs]" , "pylint" , "pytest" , "nox" )
32+ session .run ("pylint" , * check_dirs , * check_files )
2633
2734
2835@nox .session
@@ -46,7 +53,7 @@ def docstrings(session: nox.Session) -> None:
4653 """Check docstring tone with pydocstyle and param descriptions with darglint."""
4754 session .install ("pydocstyle" , "darglint" , "toml" )
4855
49- session .run ("pydocstyle" , * check_dirs )
56+ session .run ("pydocstyle" , * check_dirs , * check_files )
5057
5158 # Darglint checks that function argument and return values are documented.
5259 # This is needed only for the `src` dir, so we exclude the other top level
@@ -56,6 +63,7 @@ def docstrings(session: nox.Session) -> None:
5663
5764@nox .session
5865def pytest (session : nox .Session ) -> None :
66+ """Run all tests using pytest."""
5967 session .install ("pytest" , "pytest-cov" , "pytest-mock" , "pytest-asyncio" )
6068 session .install ("-e" , "." )
6169 session .run (
0 commit comments