Skip to content

Commit

Permalink
chore: update for linter failures (#1947)
Browse files Browse the repository at this point in the history
Just opening a separate PR for this, to keep it clean.
  • Loading branch information
feywind authored Jun 26, 2024
1 parent 76d8d0f commit 0bffecc
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 97 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/docs/
/out/
/build/
samples/build/
system-test/secrets.js
system-test/*key.json
*.lock
Expand Down
25 changes: 3 additions & 22 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,15 @@

import synthtool.languages.node as node

# This code snippet can be used to manually update the typeless bot
# to a different version than OwlBot has baked in, but this shouldn't
# be needed once it's settled down.
import os
from synthtool import shell
from synthtool.log import logger
old_path = os.getcwd()
os.chdir("/synthtool")
logger.debug("Update typeless sample bot [1.3.0]")
shell.run(["npm", "i", "@google-cloud/[email protected]"])
os.chdir(old_path)

# Generate JS samples from TS.
node.typeless_samples_hermetic()

# We need to run this before the main owlbot processing, to make
# sure quickstart.js gets gts fixed before the README is generated.
# This needs to be worked out more properly, this is temporary.
logger.debug("Copy eslint config")
shell.run(
["cp", "-r", f"/synthtool/node_modules", "."],
check=True,
)
logger.debug("Running fix...")
shell.run(
["npm", "run", "fix"],
check=False,
)
node.fix()

# Main OwlBot processing.
node.owlbot_main(templates_excludes=[
'src/index.ts',
'.github/PULL_REQUEST_TEMPLATE.md',
Expand Down
1 change: 1 addition & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"docker:disable",
":disableDependencyDashboard"
],
"constraintsFiltering": "strict",
"pinVersions": false,
"rebaseStalePrs": true,
"schedule": [
Expand Down
2 changes: 2 additions & 0 deletions samples/openTelemetryTracing.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

/* eslint-disable n/no-process-exit */

/**
* This sample demonstrates how to add OpenTelemetry tracing to the
* Google Cloud Pub/Sub API.
Expand Down
2 changes: 2 additions & 0 deletions samples/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// look for the source TypeScript sample (.ts) for modifications.
'use strict';

/* eslint-disable n/no-process-exit */

// sample-metadata:
// title: Quickstart
// description: A quick introduction to using the Pub/Sub client library.
Expand Down
4 changes: 2 additions & 2 deletions samples/system-test/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import * as defer from 'p-defer';
import {TestResources} from './testResources';
import {commandFor} from './common';

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

const execSync = (cmd: string) => cp.execSync(cmd, {encoding: 'utf-8'});
Expand Down
2 changes: 2 additions & 0 deletions samples/typescript/quickstart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

/* eslint-disable n/no-process-exit */

// sample-metadata:
// title: Quickstart
// description: A quick introduction to using the Pub/Sub client library.
Expand Down
1 change: 0 additions & 1 deletion system-test/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import defer = require('p-defer');
import * as uuid from 'uuid';

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

import {
Expand Down
48 changes: 24 additions & 24 deletions test/gapic_publisher_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1237,9 +1237,9 @@ describe('v1.PublisherClient', () => {
assert(
(client.descriptors.page.listTopics.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1285,9 +1285,9 @@ describe('v1.PublisherClient', () => {
assert(
(client.descriptors.page.listTopics.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1328,9 +1328,9 @@ describe('v1.PublisherClient', () => {
assert(
(client.descriptors.page.listTopics.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1370,9 +1370,9 @@ describe('v1.PublisherClient', () => {
assert(
(client.descriptors.page.listTopics.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});
});
Expand Down Expand Up @@ -1822,9 +1822,9 @@ describe('v1.PublisherClient', () => {
assert(
(client.descriptors.page.listTopicSnapshots.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1868,9 +1868,9 @@ describe('v1.PublisherClient', () => {
assert(
(client.descriptors.page.listTopicSnapshots.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1907,9 +1907,9 @@ describe('v1.PublisherClient', () => {
assert(
(client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1947,9 +1947,9 @@ describe('v1.PublisherClient', () => {
assert(
(client.descriptors.page.listTopicSnapshots.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});
});
Expand Down
48 changes: 24 additions & 24 deletions test/gapic_schema_service_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1502,9 +1502,9 @@ describe('v1.SchemaServiceClient', () => {
assert(
(client.descriptors.page.listSchemas.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1550,9 +1550,9 @@ describe('v1.SchemaServiceClient', () => {
assert(
(client.descriptors.page.listSchemas.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1593,9 +1593,9 @@ describe('v1.SchemaServiceClient', () => {
assert(
(client.descriptors.page.listSchemas.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1635,9 +1635,9 @@ describe('v1.SchemaServiceClient', () => {
assert(
(client.descriptors.page.listSchemas.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});
});
Expand Down Expand Up @@ -1802,9 +1802,9 @@ describe('v1.SchemaServiceClient', () => {
assert(
(client.descriptors.page.listSchemaRevisions.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1848,9 +1848,9 @@ describe('v1.SchemaServiceClient', () => {
assert(
(client.descriptors.page.listSchemaRevisions.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1891,9 +1891,9 @@ describe('v1.SchemaServiceClient', () => {
assert(
(client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1931,9 +1931,9 @@ describe('v1.SchemaServiceClient', () => {
assert(
(client.descriptors.page.listSchemaRevisions.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});
});
Expand Down
Loading

0 comments on commit 0bffecc

Please sign in to comment.