Skip to content

Commit e3afe51

Browse files
authored
add blacken to noxfile (#6795)
1 parent c821cdb commit e3afe51

File tree

1 file changed

+39
-20
lines changed

1 file changed

+39
-20
lines changed

packages/google-cloud-runtimeconfig/noxfile.py

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,45 @@
2525
)
2626

2727

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+
2867
def default(session):
2968
"""Default unit test session.
3069
"""
@@ -52,26 +91,6 @@ def unit(session):
5291
default(session)
5392

5493

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-
7594
@nox.session(python='3.6')
7695
def cover(session):
7796
"""Run the final coverage report.

0 commit comments

Comments
 (0)