Skip to content

Commit 0bffecc

Browse files
authored
chore: update for linter failures (#1947)
Just opening a separate PR for this, to keep it clean.
1 parent 76d8d0f commit 0bffecc

File tree

11 files changed

+85
-97
lines changed

11 files changed

+85
-97
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/docs/
77
/out/
88
/build/
9+
samples/build/
910
system-test/secrets.js
1011
system-test/*key.json
1112
*.lock

owlbot.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,15 @@
1414

1515
import synthtool.languages.node as node
1616

17-
# This code snippet can be used to manually update the typeless bot
18-
# to a different version than OwlBot has baked in, but this shouldn't
19-
# be needed once it's settled down.
20-
import os
21-
from synthtool import shell
22-
from synthtool.log import logger
23-
old_path = os.getcwd()
24-
os.chdir("/synthtool")
25-
logger.debug("Update typeless sample bot [1.3.0]")
26-
shell.run(["npm", "i", "@google-cloud/[email protected]"])
27-
os.chdir(old_path)
28-
17+
# Generate JS samples from TS.
2918
node.typeless_samples_hermetic()
3019

3120
# We need to run this before the main owlbot processing, to make
3221
# sure quickstart.js gets gts fixed before the README is generated.
3322
# This needs to be worked out more properly, this is temporary.
34-
logger.debug("Copy eslint config")
35-
shell.run(
36-
["cp", "-r", f"/synthtool/node_modules", "."],
37-
check=True,
38-
)
39-
logger.debug("Running fix...")
40-
shell.run(
41-
["npm", "run", "fix"],
42-
check=False,
43-
)
23+
node.fix()
4424

25+
# Main OwlBot processing.
4526
node.owlbot_main(templates_excludes=[
4627
'src/index.ts',
4728
'.github/PULL_REQUEST_TEMPLATE.md',

renovate.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"docker:disable",
55
":disableDependencyDashboard"
66
],
7+
"constraintsFiltering": "strict",
78
"pinVersions": false,
89
"rebaseStalePrs": true,
910
"schedule": [

samples/openTelemetryTracing.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
/* eslint-disable n/no-process-exit */
18+
1719
/**
1820
* This sample demonstrates how to add OpenTelemetry tracing to the
1921
* Google Cloud Pub/Sub API.

samples/quickstart.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// look for the source TypeScript sample (.ts) for modifications.
1717
'use strict';
1818

19+
/* eslint-disable n/no-process-exit */
20+
1921
// sample-metadata:
2022
// title: Quickstart
2123
// description: A quick introduction to using the Pub/Sub client library.

samples/system-test/schema.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import * as defer from 'p-defer';
3131
import {TestResources} from './testResources';
3232
import {commandFor} from './common';
3333

34-
// Tests run as Node 12.
35-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
34+
// Tests run as Node 14.
35+
// eslint-disable-next-line n/no-unsupported-features/node-builtins
3636
import {promises as fs} from 'fs';
3737

3838
const execSync = (cmd: string) => cp.execSync(cmd, {encoding: 'utf-8'});

samples/typescript/quickstart.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/* eslint-disable n/no-process-exit */
16+
1517
// sample-metadata:
1618
// title: Quickstart
1719
// description: A quick introduction to using the Pub/Sub client library.

system-test/pubsub.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import defer = require('p-defer');
1919
import * as uuid from 'uuid';
2020

2121
// This is only in Node 10.17+, but it's used for system tests, should be okay.
22-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
2322
import {promises as fs} from 'fs';
2423

2524
import {

test/gapic_publisher_v1.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,9 +1237,9 @@ describe('v1.PublisherClient', () => {
12371237
assert(
12381238
(client.descriptors.page.listTopics.createStream as SinonStub)
12391239
.getCall(0)
1240-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1241-
expectedHeaderRequestParams
1242-
)
1240+
.args[2].otherArgs.headers[
1241+
'x-goog-request-params'
1242+
].includes(expectedHeaderRequestParams)
12431243
);
12441244
});
12451245

@@ -1285,9 +1285,9 @@ describe('v1.PublisherClient', () => {
12851285
assert(
12861286
(client.descriptors.page.listTopics.createStream as SinonStub)
12871287
.getCall(0)
1288-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1289-
expectedHeaderRequestParams
1290-
)
1288+
.args[2].otherArgs.headers[
1289+
'x-goog-request-params'
1290+
].includes(expectedHeaderRequestParams)
12911291
);
12921292
});
12931293

@@ -1328,9 +1328,9 @@ describe('v1.PublisherClient', () => {
13281328
assert(
13291329
(client.descriptors.page.listTopics.asyncIterate as SinonStub)
13301330
.getCall(0)
1331-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1332-
expectedHeaderRequestParams
1333-
)
1331+
.args[2].otherArgs.headers[
1332+
'x-goog-request-params'
1333+
].includes(expectedHeaderRequestParams)
13341334
);
13351335
});
13361336

@@ -1370,9 +1370,9 @@ describe('v1.PublisherClient', () => {
13701370
assert(
13711371
(client.descriptors.page.listTopics.asyncIterate as SinonStub)
13721372
.getCall(0)
1373-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1374-
expectedHeaderRequestParams
1375-
)
1373+
.args[2].otherArgs.headers[
1374+
'x-goog-request-params'
1375+
].includes(expectedHeaderRequestParams)
13761376
);
13771377
});
13781378
});
@@ -1822,9 +1822,9 @@ describe('v1.PublisherClient', () => {
18221822
assert(
18231823
(client.descriptors.page.listTopicSnapshots.createStream as SinonStub)
18241824
.getCall(0)
1825-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1826-
expectedHeaderRequestParams
1827-
)
1825+
.args[2].otherArgs.headers[
1826+
'x-goog-request-params'
1827+
].includes(expectedHeaderRequestParams)
18281828
);
18291829
});
18301830

@@ -1868,9 +1868,9 @@ describe('v1.PublisherClient', () => {
18681868
assert(
18691869
(client.descriptors.page.listTopicSnapshots.createStream as SinonStub)
18701870
.getCall(0)
1871-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1872-
expectedHeaderRequestParams
1873-
)
1871+
.args[2].otherArgs.headers[
1872+
'x-goog-request-params'
1873+
].includes(expectedHeaderRequestParams)
18741874
);
18751875
});
18761876

@@ -1907,9 +1907,9 @@ describe('v1.PublisherClient', () => {
19071907
assert(
19081908
(client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub)
19091909
.getCall(0)
1910-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1911-
expectedHeaderRequestParams
1912-
)
1910+
.args[2].otherArgs.headers[
1911+
'x-goog-request-params'
1912+
].includes(expectedHeaderRequestParams)
19131913
);
19141914
});
19151915

@@ -1947,9 +1947,9 @@ describe('v1.PublisherClient', () => {
19471947
assert(
19481948
(client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub)
19491949
.getCall(0)
1950-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1951-
expectedHeaderRequestParams
1952-
)
1950+
.args[2].otherArgs.headers[
1951+
'x-goog-request-params'
1952+
].includes(expectedHeaderRequestParams)
19531953
);
19541954
});
19551955
});

test/gapic_schema_service_v1.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,9 +1502,9 @@ describe('v1.SchemaServiceClient', () => {
15021502
assert(
15031503
(client.descriptors.page.listSchemas.createStream as SinonStub)
15041504
.getCall(0)
1505-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1506-
expectedHeaderRequestParams
1507-
)
1505+
.args[2].otherArgs.headers[
1506+
'x-goog-request-params'
1507+
].includes(expectedHeaderRequestParams)
15081508
);
15091509
});
15101510

@@ -1550,9 +1550,9 @@ describe('v1.SchemaServiceClient', () => {
15501550
assert(
15511551
(client.descriptors.page.listSchemas.createStream as SinonStub)
15521552
.getCall(0)
1553-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1554-
expectedHeaderRequestParams
1555-
)
1553+
.args[2].otherArgs.headers[
1554+
'x-goog-request-params'
1555+
].includes(expectedHeaderRequestParams)
15561556
);
15571557
});
15581558

@@ -1593,9 +1593,9 @@ describe('v1.SchemaServiceClient', () => {
15931593
assert(
15941594
(client.descriptors.page.listSchemas.asyncIterate as SinonStub)
15951595
.getCall(0)
1596-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1597-
expectedHeaderRequestParams
1598-
)
1596+
.args[2].otherArgs.headers[
1597+
'x-goog-request-params'
1598+
].includes(expectedHeaderRequestParams)
15991599
);
16001600
});
16011601

@@ -1635,9 +1635,9 @@ describe('v1.SchemaServiceClient', () => {
16351635
assert(
16361636
(client.descriptors.page.listSchemas.asyncIterate as SinonStub)
16371637
.getCall(0)
1638-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1639-
expectedHeaderRequestParams
1640-
)
1638+
.args[2].otherArgs.headers[
1639+
'x-goog-request-params'
1640+
].includes(expectedHeaderRequestParams)
16411641
);
16421642
});
16431643
});
@@ -1802,9 +1802,9 @@ describe('v1.SchemaServiceClient', () => {
18021802
assert(
18031803
(client.descriptors.page.listSchemaRevisions.createStream as SinonStub)
18041804
.getCall(0)
1805-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1806-
expectedHeaderRequestParams
1807-
)
1805+
.args[2].otherArgs.headers[
1806+
'x-goog-request-params'
1807+
].includes(expectedHeaderRequestParams)
18081808
);
18091809
});
18101810

@@ -1848,9 +1848,9 @@ describe('v1.SchemaServiceClient', () => {
18481848
assert(
18491849
(client.descriptors.page.listSchemaRevisions.createStream as SinonStub)
18501850
.getCall(0)
1851-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1852-
expectedHeaderRequestParams
1853-
)
1851+
.args[2].otherArgs.headers[
1852+
'x-goog-request-params'
1853+
].includes(expectedHeaderRequestParams)
18541854
);
18551855
});
18561856

@@ -1891,9 +1891,9 @@ describe('v1.SchemaServiceClient', () => {
18911891
assert(
18921892
(client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub)
18931893
.getCall(0)
1894-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1895-
expectedHeaderRequestParams
1896-
)
1894+
.args[2].otherArgs.headers[
1895+
'x-goog-request-params'
1896+
].includes(expectedHeaderRequestParams)
18971897
);
18981898
});
18991899

@@ -1931,9 +1931,9 @@ describe('v1.SchemaServiceClient', () => {
19311931
assert(
19321932
(client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub)
19331933
.getCall(0)
1934-
.args[2].otherArgs.headers['x-goog-request-params'].includes(
1935-
expectedHeaderRequestParams
1936-
)
1934+
.args[2].otherArgs.headers[
1935+
'x-goog-request-params'
1936+
].includes(expectedHeaderRequestParams)
19371937
);
19381938
});
19391939
});

0 commit comments

Comments
 (0)