From 2df7995669ddfd1b5adb3a3a7321597d3ff020ca Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Thu, 23 May 2019 17:02:30 +0300 Subject: [PATCH] findBreakingChanges: add missing dots to descriptions --- .../__tests__/findBreakingChanges-test.js | 58 +++++++++---------- src/utilities/findBreakingChanges.js | 18 +++--- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/utilities/__tests__/findBreakingChanges-test.js b/src/utilities/__tests__/findBreakingChanges-test.js index f4ee5f6b22..1ffa4e6acd 100644 --- a/src/utilities/__tests__/findBreakingChanges-test.js +++ b/src/utilities/__tests__/findBreakingChanges-test.js @@ -372,15 +372,15 @@ describe('findBreakingChanges', () => { expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ { type: BreakingChangeType.ARG_REMOVED, - description: 'Interface1.field1 arg arg1 was removed', + description: 'Interface1.field1 arg arg1 was removed.', }, { type: BreakingChangeType.ARG_REMOVED, - description: 'Interface1.field1 arg objectArg was removed', + description: 'Interface1.field1 arg objectArg was removed.', }, { type: BreakingChangeType.ARG_REMOVED, - description: 'Type1.field1 arg name was removed', + description: 'Type1.field1 arg name was removed.', }, ]); }); @@ -434,62 +434,62 @@ describe('findBreakingChanges', () => { { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg1 has changed type from String to Int', + 'Type1.field1 arg arg1 has changed type from String to Int.', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg2 has changed type from String to [String]', + 'Type1.field1 arg arg2 has changed type from String to [String].', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg3 has changed type from [String] to String', + 'Type1.field1 arg arg3 has changed type from [String] to String.', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg4 has changed type from String to String!', + 'Type1.field1 arg arg4 has changed type from String to String!.', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg5 has changed type from String! to Int', + 'Type1.field1 arg arg5 has changed type from String! to Int.', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg6 has changed type from String! to Int!', + 'Type1.field1 arg arg6 has changed type from String! to Int!.', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg8 has changed type from Int to [Int]!', + 'Type1.field1 arg arg8 has changed type from Int to [Int]!.', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg9 has changed type from [Int] to [Int!]', + 'Type1.field1 arg arg9 has changed type from [Int] to [Int!].', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg11 has changed type from [Int] to [[Int]]', + 'Type1.field1 arg arg11 has changed type from [Int] to [[Int]].', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg12 has changed type from [[Int]] to [Int]', + 'Type1.field1 arg arg12 has changed type from [[Int]] to [Int].', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg13 has changed type from Int! to [Int]!', + 'Type1.field1 arg arg13 has changed type from Int! to [Int]!.', }, { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'Type1.field1 arg arg15 has changed type from [[Int]!] to [[Int!]!]', + 'Type1.field1 arg arg15 has changed type from [[Int]!] to [[Int!]!].', }, ]); }); @@ -515,7 +515,7 @@ describe('findBreakingChanges', () => { expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ { type: BreakingChangeType.REQUIRED_ARG_ADDED, - description: 'A required arg newRequiredArg on Type1.field1 was added', + description: 'A required arg newRequiredArg on Type1.field1 was added.', }, ]); }); @@ -702,7 +702,7 @@ describe('findBreakingChanges', () => { { type: BreakingChangeType.ARG_CHANGED_KIND, description: - 'ArgThatChanges.field1 arg id has changed type from Int to String', + 'ArgThatChanges.field1 arg id has changed type from Int to String.', }, { type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT, @@ -711,20 +711,20 @@ describe('findBreakingChanges', () => { }, { type: BreakingChangeType.DIRECTIVE_REMOVED, - description: 'DirectiveThatIsRemoved was removed', + description: 'DirectiveThatIsRemoved was removed.', }, { type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, - description: 'arg1 was removed from DirectiveThatRemovesArg', + description: 'arg1 was removed from DirectiveThatRemovesArg.', }, { type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, description: - 'A required arg arg1 on directive NonNullDirectiveAdded was added', + 'A required arg arg1 on directive NonNullDirectiveAdded was added.', }, { type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, - description: 'QUERY was removed from DirectiveName', + description: 'QUERY was removed from DirectiveName.', }, ]); }); @@ -742,7 +742,7 @@ describe('findBreakingChanges', () => { expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ { type: BreakingChangeType.DIRECTIVE_REMOVED, - description: `DirectiveThatIsRemoved was removed`, + description: `DirectiveThatIsRemoved was removed.`, }, ]); }); @@ -757,7 +757,7 @@ describe('findBreakingChanges', () => { expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ { type: BreakingChangeType.DIRECTIVE_REMOVED, - description: `${GraphQLDeprecatedDirective.name} was removed`, + description: `${GraphQLDeprecatedDirective.name} was removed.`, }, ]); }); @@ -774,7 +774,7 @@ describe('findBreakingChanges', () => { expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ { type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, - description: 'arg1 was removed from DirectiveWithArg', + description: 'arg1 was removed from DirectiveWithArg.', }, ]); }); @@ -796,7 +796,7 @@ describe('findBreakingChanges', () => { { type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, description: - 'A required arg newRequiredArg on directive DirectiveName was added', + 'A required arg newRequiredArg on directive DirectiveName was added.', }, ]); }); @@ -813,7 +813,7 @@ describe('findBreakingChanges', () => { expect(findBreakingChanges(oldSchema, newSchema)).to.deep.equal([ { type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, - description: 'QUERY was removed from DirectiveName', + description: 'QUERY was removed from DirectiveName.', }, ]); }); @@ -836,7 +836,7 @@ describe('findDangerousChanges', () => { expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ { type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, - description: 'Type1.field1 arg name has changed defaultValue', + description: 'Type1.field1 arg name has changed defaultValue.', }, ]); }); @@ -974,7 +974,7 @@ describe('findDangerousChanges', () => { expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ { description: - 'Type1.field1 arg argThatChangesDefaultValue has changed defaultValue', + 'Type1.field1 arg argThatChangesDefaultValue has changed defaultValue.', type: 'ARG_DEFAULT_VALUE_CHANGE', }, { @@ -1010,7 +1010,7 @@ describe('findDangerousChanges', () => { expect(findDangerousChanges(oldSchema, newSchema)).to.deep.equal([ { type: DangerousChangeType.OPTIONAL_ARG_ADDED, - description: 'An optional arg arg2 on Type1.field1 was added', + description: 'An optional arg arg2 on Type1.field1 was added.', }, ]); }); diff --git a/src/utilities/findBreakingChanges.js b/src/utilities/findBreakingChanges.js index e313e7d538..cd18f35d62 100644 --- a/src/utilities/findBreakingChanges.js +++ b/src/utilities/findBreakingChanges.js @@ -214,7 +214,7 @@ function findArgChanges( type: BreakingChangeType.ARG_REMOVED, description: `${oldType.name}.${fieldName} arg ` + - `${oldArgDef.name} was removed`, + `${oldArgDef.name} was removed.`, }); } else { const isSafe = isChangeSafeForInputObjectFieldOrFieldArg( @@ -227,7 +227,7 @@ function findArgChanges( description: `${oldType.name}.${fieldName} arg ` + `${oldArgDef.name} has changed type from ` + - `${String(oldArgDef.type)} to ${String(newArgDef.type)}`, + `${String(oldArgDef.type)} to ${String(newArgDef.type)}.`, }); } else if ( oldArgDef.defaultValue !== undefined && @@ -237,7 +237,7 @@ function findArgChanges( type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, description: `${oldType.name}.${fieldName} arg ` + - `${oldArgDef.name} has changed defaultValue`, + `${oldArgDef.name} has changed defaultValue.`, }); } } @@ -253,14 +253,14 @@ function findArgChanges( type: BreakingChangeType.REQUIRED_ARG_ADDED, description: `A required arg ${argName} on ` + - `${typeName}.${fieldName} was added`, + `${typeName}.${fieldName} was added.`, }); } else { dangerousChanges.push({ type: DangerousChangeType.OPTIONAL_ARG_ADDED, description: `An optional arg ${argName} on ` + - `${typeName}.${fieldName} was added`, + `${typeName}.${fieldName} was added.`, }); } } @@ -696,7 +696,7 @@ function findRemovedDirectives( if (!newSchemaDirectiveMap[directive.name]) { removedDirectives.push({ type: BreakingChangeType.DIRECTIVE_REMOVED, - description: `${directive.name} was removed`, + description: `${directive.name} was removed.`, }); } } @@ -736,7 +736,7 @@ function findRemovedDirectiveArgs( for (const arg of findRemovedArgsForDirective(oldDirective, newDirective)) { removedDirectiveArgs.push({ type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, - description: `${arg.name} was removed from ${newDirective.name}`, + description: `${arg.name} was removed from ${newDirective.name}.`, }); } } @@ -779,7 +779,7 @@ function findAddedNonNullDirectiveArgs( type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, description: `A required arg ${arg.name} on directive ` + - `${newDirective.name} was added`, + `${newDirective.name} was added.`, }); } } @@ -823,7 +823,7 @@ function findRemovedDirectiveLocations( )) { removedLocations.push({ type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, - description: `${location} was removed from ${newDirective.name}`, + description: `${location} was removed from ${newDirective.name}.`, }); } }