Skip to content

Commit 4b366c9

Browse files
yoshi-automationtseaver
authored andcommitted
Blacken (via synth). (googleapis#8282)
1 parent a14ffba commit 4b366c9

2 files changed

Lines changed: 27 additions & 29 deletions

File tree

translate/noxfile.py

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323

2424
LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core"))
2525

26+
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
27+
28+
if os.path.exists("samples"):
29+
BLACK_PATHS.append("samples")
30+
31+
2632
@nox.session(python="3.7")
2733
def lint(session):
2834
"""Run linters.
@@ -31,13 +37,7 @@ def lint(session):
3137
serious code quality issues.
3238
"""
3339
session.install("flake8", "black", *LOCAL_DEPS)
34-
session.run(
35-
"black",
36-
"--check",
37-
"google",
38-
"tests",
39-
"docs",
40-
)
40+
session.run("black", "--check", *BLACK_PATHS)
4141
session.run("flake8", "google", "tests")
4242

4343

@@ -46,18 +46,13 @@ def blacken(session):
4646
"""Run black.
4747
4848
Format code to uniform standard.
49-
49+
5050
This currently uses Python 3.6 due to the automated Kokoro run of synthtool.
5151
That run uses an image that doesn't have 3.6 installed. Before updating this
5252
check the state of the `gcp_ubuntu_config` we use for that Kokoro run.
5353
"""
5454
session.install("black")
55-
session.run(
56-
"black",
57-
"google",
58-
"tests",
59-
"docs",
60-
)
55+
session.run("black", *BLACK_PATHS)
6156

6257

6358
@nox.session(python="3.7")
@@ -83,7 +78,7 @@ def default(session):
8378
"--cov-append",
8479
"--cov-config=.coveragerc",
8580
"--cov-report=",
86-
"--cov-fail-under=100",
81+
"--cov-fail-under=0",
8782
os.path.join("tests", "unit"),
8883
*session.posargs,
8984
)
@@ -140,21 +135,24 @@ def cover(session):
140135

141136
session.run("coverage", "erase")
142137

138+
143139
@nox.session(python="3.7")
144140
def docs(session):
145141
"""Build the docs for this library."""
146142

147-
session.install('-e', '.')
148-
session.install('sphinx', 'alabaster', 'recommonmark')
143+
session.install("-e", ".")
144+
session.install("sphinx", "alabaster", "recommonmark")
149145

150-
shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
146+
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
151147
session.run(
152-
'sphinx-build',
153-
'-W', # warnings as errors
154-
'-T', # show full traceback on exception
155-
'-N', # no colors
156-
'-b', 'html',
157-
'-d', os.path.join('docs', '_build', 'doctrees', ''),
158-
os.path.join('docs', ''),
159-
os.path.join('docs', '_build', 'html', ''),
148+
"sphinx-build",
149+
"-W", # warnings as errors
150+
"-T", # show full traceback on exception
151+
"-N", # no colors
152+
"-b",
153+
"html",
154+
"-d",
155+
os.path.join("docs", "_build", "doctrees", ""),
156+
os.path.join("docs", ""),
157+
os.path.join("docs", "_build", "html", ""),
160158
)

translate/synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"updateTime": "2019-06-10T16:41:47.015823Z",
2+
"updateTime": "2019-06-11T12:35:02.295672Z",
33
"sources": [
44
{
55
"generator": {
@@ -12,8 +12,8 @@
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "a12347ec47a7f3d18e35f2effc4295c0b0983213",
16-
"internalRef": "252108410"
15+
"sha": "744feb9660b3194fcde37dea50038bde204f3573",
16+
"internalRef": "252553801"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)