Skip to content

Commit 2b6ef3f

Browse files
authored
add blacken to noxfile (#6795)
1 parent 93e2e5a commit 2b6ef3f

1 file changed

Lines changed: 39 additions & 21 deletions

File tree

packages/google-cloud-dns/noxfile.py

Lines changed: 39 additions & 21 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
@@ -60,27 +99,6 @@ def unit(session):
6099
default(session)
61100

62101

63-
@nox.session(python='3.6')
64-
def lint(session):
65-
"""Run linters.
66-
67-
Returns a failure if the linters find linting errors or sufficiently
68-
serious code quality issues.
69-
"""
70-
session.install('flake8', *LOCAL_DEPS)
71-
session.install('.')
72-
session.run('flake8', 'google', 'tests')
73-
74-
75-
@nox.session(python='3.6')
76-
def lint_setup_py(session):
77-
"""Verify that setup.py is valid (including RST check)."""
78-
79-
session.install('docutils', 'Pygments')
80-
session.run(
81-
'python', 'setup.py', 'check', '--restructuredtext', '--strict')
82-
83-
84102
@nox.session(python='3.6')
85103
def cover(session):
86104
"""Run the final coverage report.

0 commit comments

Comments
 (0)