Skip to content

Commit de3c5c4

Browse files
committed
Added linting corrections.
1 parent a275976 commit de3c5c4

File tree

8 files changed

+43
-41
lines changed

8 files changed

+43
-41
lines changed

ai-platform/snippets/predict-text-embeddings.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ async function main(
3737
const instances = texts
3838
.split(';')
3939
.map(e => helpers.toValue({content: e, task_type: task}));
40-
40+
4141
const client = new PredictionServiceClient(clientOptions);
4242
const parameters = helpers.toValue(
4343
dimensionality > 0 ? {outputDimensionality: parseInt(dimensionality)} : {}
4444
);
45-
const allEmbeddings = []
45+
const allEmbeddings = [];
4646
// gemini-embedding-001 takes one input at a time.
4747
for (const instance of instances) {
4848
const request = {endpoint, instances: [instance], parameters};
@@ -55,10 +55,9 @@ async function main(
5555
return valuesProto.listValue.values.map(v => v.numberValue);
5656
});
5757

58-
allEmbeddings.push(embeddings[0])
58+
allEmbeddings.push(embeddings[0]);
5959
}
6060

61-
6261
console.log('Got embeddings: \n' + JSON.stringify(allEmbeddings));
6362
}
6463

cloud-sql/sqlserver/mssql/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ const createPool = async () => {
6262
config.pool.acquireTimeoutMillis = 30000;
6363
// 'idleTimeoutMillis' is the number of milliseconds a connection must sit idle in the pool
6464
// and not be checked out before it is automatically closed
65-
(config.pool.idleTimeoutMillis = 600000),
66-
// [END cloud_sql_sqlserver_mssql_timeout]
67-
// [START cloud_sql_sqlserver_mssql_limit]
68-
// 'max' limits the total number of concurrent connections this pool will keep. Ideal
69-
// values for this setting are highly variable on app design, infrastructure, and database.
70-
(config.pool.max = 5);
65+
config.pool.idleTimeoutMillis = 600000;
66+
// [END cloud_sql_sqlserver_mssql_timeout]
67+
// [START cloud_sql_sqlserver_mssql_limit]
68+
// 'max' limits the total number of concurrent connections this pool will keep. Ideal
69+
// values for this setting are highly variable on app design, infrastructure, and database.
70+
config.pool.max = 5;
7171
// 'min' is the minimum number of idle connections maintained in the pool.
7272
// Additional connections will be established to meet this value unless the pool is full.
7373
config.pool.min = 1;

recaptcha_enterprise/snippets/passwordLeakAssessment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ checkPasswordLeak(projectId, username, password).catch(err => {
166166
process.exitCode = 1;
167167
});
168168
// [END recaptcha_enterprise_password_leak_verification]
169-
module.exports = checkPasswordLeak
169+
module.exports = checkPasswordLeak;

scheduler/createJob.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
const args = process.argv.slice(2);
2323
const [projectId, locationId, serviceId] = args;
2424
// [START cloudscheduler_create_job]
25-
import { CloudSchedulerClient } from '@google-cloud/scheduler';
25+
import {CloudSchedulerClient} from '@google-cloud/scheduler';
2626
// TODO(developer): Uncomment and set the following variables
2727
// const projectId = "PROJECT_ID"
2828
// const locationId = "LOCATION_ID"
@@ -33,31 +33,31 @@ const client = new CloudSchedulerClient();
3333
* Create a job with an App Engine target via the Cloud Scheduler API
3434
*/
3535
async function createJob(projectId, locationId, serviceId) {
36-
// Construct the fully qualified location path.
37-
const parent = client.locationPath(projectId, locationId);
38-
// Construct the request body.
39-
const job = {
40-
appEngineHttpTarget: {
41-
appEngineRouting: {
42-
service: serviceId,
43-
},
44-
relativeUri: '/log_payload',
45-
httpMethod: 'POST',
46-
body: Buffer.from('Hello World'),
47-
},
48-
schedule: '* * * * *',
49-
timeZone: 'America/Los_Angeles',
50-
};
51-
const request = {
52-
parent: parent,
53-
job: job,
54-
};
55-
// Use the client to send the job creation request.
56-
const [response] = await client.createJob(request);
57-
console.log(`Created job: ${response.name}`);
36+
// Construct the fully qualified location path.
37+
const parent = client.locationPath(projectId, locationId);
38+
// Construct the request body.
39+
const job = {
40+
appEngineHttpTarget: {
41+
appEngineRouting: {
42+
service: serviceId,
43+
},
44+
relativeUri: '/log_payload',
45+
httpMethod: 'POST',
46+
body: Buffer.from('Hello World'),
47+
},
48+
schedule: '* * * * *',
49+
timeZone: 'America/Los_Angeles',
50+
};
51+
const request = {
52+
parent: parent,
53+
job: job,
54+
};
55+
// Use the client to send the job creation request.
56+
const [response] = await client.createJob(request);
57+
console.log(`Created job: ${response.name}`);
5858
}
5959
createJob(projectId, locationId, serviceId).catch(err => {
60-
console.error(err.message);
61-
process.exitCode = 1;
60+
console.error(err.message);
61+
process.exitCode = 1;
6262
});
6363
// [END cloudscheduler_create_job]

security-center/snippets/management_api/createSecurityHealthAnalyticsCustomModule.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ function main(organizationId, customModuleDisplayName, locationId = 'global') {
5454
// define the CEL expression here and this will scans for keys that have not been rotated in
5555
// the last 30 days, change it according to your requirements
5656
const expr = {
57-
expression: `has(resource.rotationPeriod) && (resource.rotationPeriod > duration('2592000s'))`,
57+
expression:
58+
"has(resource.rotationPeriod) && (resource.rotationPeriod > duration('2592000s'))",
5859
};
5960

6061
// define the resource selector

security-center/snippets/management_api/simulateSecurityHealthAnalyticsCustomModule.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ function main(organizationId, locationId = 'global') {
4141
// define the CEL expression here and this will scans for keys that have not been rotated in
4242
// the last 30 days, change it according to the your requirements
4343
const expr = {
44-
expression: `has(resource.rotationPeriod) && (resource.rotationPeriod > duration('2592000s'))`,
44+
expression:
45+
"has(resource.rotationPeriod) && (resource.rotationPeriod > duration('2592000s'))",
4546
};
4647

4748
// define the resource selector

security-center/snippets/system-test/management_api/securityHealthAnalyticsCustomModule.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ describe('security health analytics custom module', async () => {
4444
const parent = `organizations/${organizationId}/locations/${locationId}`;
4545
const name = `organizations/${organizationId}/locations/${locationId}/securityHealthAnalyticsCustomModules/custom_module`;
4646
const expr = {
47-
expression: `has(resource.rotationPeriod) && (resource.rotationPeriod > duration('2592000s'))`,
47+
expression:
48+
"has(resource.rotationPeriod) && (resource.rotationPeriod > duration('2592000s'))",
4849
};
4950
const resourceSelector = {
5051
resourceTypes: ['cloudkms.googleapis.com/CryptoKey'],

translate/test/v3/translate_batch_translate_text.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe(REGION_TAG, () => {
4646
const bucketName = `translation-${bucketUuid}/BATCH_TRANSLATE_OUTPUT/`;
4747
const storage = new Storage();
4848

49-
before(async () => {
49+
(before(async () => {
5050
const projectId = await translationClient.getProjectId();
5151

5252
//Create bucket if needed
@@ -88,5 +88,5 @@ describe(REGION_TAG, () => {
8888
if (length > 0) {
8989
await Promise.all(files.map(file => file.delete()));
9090
}
91-
});
91+
}));
9292
});

0 commit comments

Comments
 (0)