Skip to content

Commit

Permalink
add blacken to noxfile (#6795)
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox authored Nov 30, 2018
1 parent c8d6026 commit 9789509
Showing 1 changed file with 38 additions and 20 deletions.
58 changes: 38 additions & 20 deletions packages/google-cloud-translate/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,44 @@
os.path.join('..', 'core'),
)

@nox.session(python="3.7")
def lint(session):
"""Run linters.
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
"""
session.install("flake8", "black", *LOCAL_DEPS)
session.run(
"black",
"--check",
"google",
"tests",
"docs",
)
session.run("flake8", "google", "tests")


@nox.session(python="3.6")
def blacken(session):
"""Run black.
Format code to uniform standard.
"""
session.install("black")
session.run(
"black",
"google",
"tests",
"docs",
)


@nox.session(python='3.6')
def lint_setup_py(session):
"""Verify that setup.py is valid (including RST check)."""
session.install('docutils', 'Pygments')
session.run(
'python', 'setup.py', 'check', '--restructuredtext', '--strict')


def default(session):
"""Default unit test session."""
Expand Down Expand Up @@ -70,26 +108,6 @@ def system(session):
session.run('py.test', '--quiet', 'tests/system.py')


@nox.session(python='3.6')
def lint(session):
"""Run linters.
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
"""
session.install('flake8', *LOCAL_DEPS)
session.install('.')
session.run('flake8', 'google', 'tests')


@nox.session(python='3.6')
def lint_setup_py(session):
"""Verify that setup.py is valid (including RST check)."""
session.install('docutils', 'Pygments')
session.run(
'python', 'setup.py', 'check', '--restructuredtext', '--strict')


@nox.session(python='3.6')
def cover(session):
"""Run the final coverage report.
Expand Down

0 comments on commit 9789509

Please sign in to comment.