Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce black in noxfile, broaden to generated code #151

Merged
merged 1 commit into from
Nov 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions synthtool/gcp/templates/python_library/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,36 @@ import nox
LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core"))

@nox.session(python="3.7")
def blacken(session):
"""Run black.
def lint(session):
"""Run linters.

Format code to uniform standard.
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
"""
session.install("black")
session.install("flake8", "black", *LOCAL_DEPS)
session.run(
"black",
"--check",
"google",
"tests",
"docs",
"--exclude",
".*/proto/.*|.*/gapic/.*|.*/.*_pb2.py",
)
session.run("flake8", "google", "tests")


@nox.session(python="3.7")
def lint(session):
"""Run linters.
def blacken(session):
"""Run black.

Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
Format code to uniform standard.
"""
session.install("flake8", "black", *LOCAL_DEPS)
session.install("black")
session.run(
"black",
"--check",
"google",
"tests",
"docs",
"--exclude",
".*/proto/.*|.*/gapic/.*|.*/.*_pb2.py",
)
session.run("flake8", "google", "tests")


@nox.session(python="3.7")
Expand Down