Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findBreakingChanges: add missing dots to descriptions #1903

Merged
merged 1 commit into from May 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 29 additions & 29 deletions src/utilities/__tests__/findBreakingChanges-test.js
Expand Up @@ -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.',
},
]);
});
Expand Down Expand Up @@ -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!]!].',
},
]);
});
Expand All @@ -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.',
},
]);
});
Expand Down Expand Up @@ -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,
Expand All @@ -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.',
},
]);
});
Expand All @@ -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.`,
},
]);
});
Expand All @@ -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.`,
},
]);
});
Expand All @@ -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.',
},
]);
});
Expand All @@ -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.',
},
]);
});
Expand All @@ -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.',
},
]);
});
Expand All @@ -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.',
},
]);
});
Expand Down Expand Up @@ -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',
},
{
Expand Down Expand Up @@ -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.',
},
]);
});
Expand Down
18 changes: 9 additions & 9 deletions src/utilities/findBreakingChanges.js
Expand Up @@ -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(
Expand All @@ -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 &&
Expand All @@ -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.`,
});
}
}
Expand All @@ -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.`,
});
}
}
Expand Down Expand Up @@ -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.`,
});
}
}
Expand Down Expand Up @@ -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}.`,
});
}
}
Expand Down Expand Up @@ -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.`,
});
}
}
Expand Down Expand Up @@ -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}.`,
});
}
}
Expand Down