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

Run black at end of synth.py #6698

Merged
merged 2 commits into from
Nov 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions asset/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@
# ----------------------------------------------------------------------------
templated_files = gcp.CommonTemplates().py_library(unit_cov_level=79, cov_level=80)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions automl/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=82, cov_level=83)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions bigquery_datatransfer/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=80, cov_level=80)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions bigtable/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=99)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions container/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=76, cov_level=77)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions dataproc/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions datastore/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions dlp/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions error_reporting/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions firestore/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions iot/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=80, cov_level=80)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions kms/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions language/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=87, cov_level=87)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
27 changes: 12 additions & 15 deletions logging/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,38 @@
'webob',
)


@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
4 changes: 3 additions & 1 deletion logging/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=95, cov_level=100)
# Don't move noxfile. logging has special testing setups for django, etc
s.move(templated_files, exclude="noxfile.py")
s.move(templated_files, excludes="noxfile.py")

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions monitoring/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=97)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions oslogin/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions pubsub/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@
# ----------------------------------------------------------------------------
templated_files = gcp.CommonTemplates().py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions redis/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions scheduler/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=79, cov_level=80)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions securitycenter/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions spanner/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions speech/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions tasks/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions texttospeech/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions trace/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions videointelligence/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions vision/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@
unit_cov_level=97, cov_level=100, system_test_dependencies=["../storage"]
)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 2 additions & 0 deletions websecurityscanner/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)