|
25 | 25 | ) |
26 | 26 |
|
27 | 27 |
|
| 28 | +@nox.session(python="3.7") |
| 29 | +def lint(session): |
| 30 | + """Run linters. |
| 31 | + Returns a failure if the linters find linting errors or sufficiently |
| 32 | + serious code quality issues. |
| 33 | + """ |
| 34 | + session.install("flake8", "black", *LOCAL_DEPS) |
| 35 | + session.run( |
| 36 | + "black", |
| 37 | + "--check", |
| 38 | + "google", |
| 39 | + "tests", |
| 40 | + "docs", |
| 41 | + ) |
| 42 | + session.run("flake8", "google", "tests") |
| 43 | + |
| 44 | + |
| 45 | +@nox.session(python="3.6") |
| 46 | +def blacken(session): |
| 47 | + """Run black. |
| 48 | + Format code to uniform standard. |
| 49 | + """ |
| 50 | + session.install("black") |
| 51 | + session.run( |
| 52 | + "black", |
| 53 | + "google", |
| 54 | + "tests", |
| 55 | + "docs", |
| 56 | + ) |
| 57 | + |
| 58 | + |
| 59 | +@nox.session(python='3.6') |
| 60 | +def lint_setup_py(session): |
| 61 | + """Verify that setup.py is valid (including RST check).""" |
| 62 | + session.install('docutils', 'Pygments') |
| 63 | + session.run( |
| 64 | + 'python', 'setup.py', 'check', '--restructuredtext', '--strict') |
| 65 | + |
| 66 | + |
28 | 67 | def default(session): |
29 | 68 | """Default unit test session. |
30 | 69 | """ |
@@ -52,26 +91,6 @@ def unit(session): |
52 | 91 | default(session) |
53 | 92 |
|
54 | 93 |
|
55 | | -@nox.session(python='3.6') |
56 | | -def lint(session): |
57 | | - """Run linters. |
58 | | -
|
59 | | - Returns a failure if the linters find linting errors or sufficiently |
60 | | - serious code quality issues. |
61 | | - """ |
62 | | - session.install('flake8', *LOCAL_DEPS) |
63 | | - session.install('.') |
64 | | - session.run('flake8', 'google', 'tests') |
65 | | - |
66 | | - |
67 | | -@nox.session(python='3.6') |
68 | | -def lint_setup_py(session): |
69 | | - """Verify that setup.py is valid (including RST check).""" |
70 | | - session.install('docutils', 'Pygments') |
71 | | - session.run( |
72 | | - 'python', 'setup.py', 'check', '--restructuredtext', '--strict') |
73 | | - |
74 | | - |
75 | 94 | @nox.session(python='3.6') |
76 | 95 | def cover(session): |
77 | 96 | """Run the final coverage report. |
|
0 commit comments