Skip to content

Commit

Permalink
fix: remove eslint, update gax, fix generated protos, run the generat…
Browse files Browse the repository at this point in the history
…or (#447)

Run the latest version of the generator, update google-gax, update gts, and remove direct dependencies on eslint.
  • Loading branch information
alexander-fenster authored Apr 11, 2020
1 parent 74f3105 commit 40b5ea1
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 38 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-language/.jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2019 Google, LLC.',
copyright: 'Copyright 2020 Google LLC',
includeDate: false,
sourceFiles: false,
systemName: '@google-cloud/language',
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-language/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
12 changes: 4 additions & 8 deletions packages/google-cloud-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
],
"scripts": {
"docs": "jsdoc -c .jsdoc.js",
"lint": "gts fix && eslint --fix samples/*.js",
"lint": "gts fix",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"system-test": "mocha build/system-test",
"test": "c8 mocha build/test",
Expand All @@ -42,22 +42,18 @@
"compile-protos": "compileProtos src",
"predocs-test": "npm run docs",
"prepare": "npm run compile",
"prelint": "cd samples; npm link ../; npm i"
"prelint": "cd samples; npm link ../; npm install"
},
"dependencies": {
"google-gax": "^2.0.1"
"google-gax": "^2.1.0"
},
"devDependencies": {
"@types/mocha": "^7.0.0",
"@types/node": "^12.0.0",
"@types/sinon": "^7.5.2",
"c8": "^7.0.0",
"codecov": "^3.0.2",
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.0.0",
"gts": "2.0.0",
"gts": "^2.0.0",
"jsdoc": "^3.5.5",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ message Document {
// The language of the document (if not specified, the language is
// automatically detected). Both ISO and BCP-47 language codes are
// accepted.<br>
// [Language Support](/natural-language/docs/languages)
// lists currently supported languages for each API method.
// If the language (either specified by the caller or automatically detected)
// is not supported by the called API method, an `INVALID_ARGUMENT` error
// is returned.
// [Language
// Support](https://cloud.google.com/natural-language/docs/languages) lists
// currently supported languages for each API method. If the language (either
// specified by the caller or automatically detected) is not supported by the
// called API method, an `INVALID_ARGUMENT` error is returned.
string language = 4;
}

Expand Down Expand Up @@ -954,7 +954,7 @@ message TextSpan {
// Represents a category returned from the text classifier.
message ClassificationCategory {
// The name of the category representing the document, from the [predefined
// taxonomy](/natural-language/docs/categories).
// taxonomy](https://cloud.google.com/natural-language/docs/categories).
string name = 1;

// The classifier's confidence of the category. Number represents how certain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ message Document {
// The language of the document (if not specified, the language is
// automatically detected). Both ISO and BCP-47 language codes are
// accepted.<br>
// [Language Support](/natural-language/docs/languages)
// lists currently supported languages for each API method.
// If the language (either specified by the caller or automatically detected)
// is not supported by the called API method, an `INVALID_ARGUMENT` error
// is returned.
// [Language
// Support](https://cloud.google.com/natural-language/docs/languages) lists
// currently supported languages for each API method. If the language (either
// specified by the caller or automatically detected) is not supported by the
// called API method, an `INVALID_ARGUMENT` error is returned.
string language = 4;
}

Expand Down Expand Up @@ -961,7 +961,7 @@ message TextSpan {
// Represents a category returned from the text classifier.
message ClassificationCategory {
// The name of the category representing the document, from the [predefined
// taxonomy](/natural-language/docs/categories).
// taxonomy](https://cloud.google.com/natural-language/docs/categories).
string name = 1;

// The classifier's confidence of the category. Number represents how certain
Expand Down Expand Up @@ -1089,7 +1089,8 @@ message AnnotateTextRequest {

// Classify the full document into categories. If this is true,
// the API will use the default model which classifies into a
// [predefined taxonomy](/natural-language/docs/categories).
// [predefined
// taxonomy](https://cloud.google.com/natural-language/docs/categories).
bool classify_text = 6;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-language/protos/protos.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
var $root = $protobuf.roots._google_cloud_language_3_8_0_protos || ($protobuf.roots._google_cloud_language_3_8_0_protos = {});

$root.google = (function() {

Expand Down
11 changes: 10 additions & 1 deletion packages/google-cloud-language/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"updateTime": "2020-03-31T19:47:14.953977Z",
"updateTime": "2020-04-11T00:27:32.512826Z",
"sources": [
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5"
}
}
],
"destinations": [
{
"client": {
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-language/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@

# Node.js specific cleanup
subprocess.run(['npm', 'install'])
subprocess.run(['npm', 'run', 'fix'])
subprocess.run(['npm', 'run', 'lint'])
subprocess.run(['npx', 'compileProtos', 'src'])
12 changes: 6 additions & 6 deletions packages/google-cloud-language/test/gapic_language_service_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('v1.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.analyzeSentiment(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -302,7 +302,7 @@ describe('v1.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.analyzeEntities(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -394,7 +394,7 @@ describe('v1.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.analyzeEntitySentiment(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -484,7 +484,7 @@ describe('v1.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.analyzeSyntax(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -574,7 +574,7 @@ describe('v1.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.classifyText(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -664,7 +664,7 @@ describe('v1.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.annotateText(request);
}, expectedError);
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('v1beta2.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.analyzeSentiment(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -302,7 +302,7 @@ describe('v1beta2.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.analyzeEntities(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -394,7 +394,7 @@ describe('v1beta2.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.analyzeEntitySentiment(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -484,7 +484,7 @@ describe('v1beta2.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.analyzeSyntax(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -574,7 +574,7 @@ describe('v1beta2.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.classifyText(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -664,7 +664,7 @@ describe('v1beta2.LanguageServiceClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.annotateText(request);
}, expectedError);
assert(
Expand Down

0 comments on commit 40b5ea1

Please sign in to comment.