Skip to content

Commit 5b7b9f6

Browse files
authored
Add spellcheck to test suite (#858)
* Add spellcheck to test suite * Add README
1 parent 086bb1f commit 5b7b9f6

8 files changed

+1727
-118
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ or are actively interested in, building their own GraphQL implementations and
2323
tools.
2424

2525
In order to be broadly adopted, GraphQL will have to target a wide
26-
variety of backends, frameworks, and languages, which will necessitate a
26+
variety of backend environments, frameworks, and languages, which will necessitate a
2727
collaborative effort across projects and organizations. This specification serves as a point of coordination for this effort.
2828

2929
Looking for help? Find resources [from the community](https://graphql.org/community/).
@@ -271,7 +271,6 @@ case, `Query`. As defined above, `Query` has a `hero` field that returns a
271271
returns a `String`, so we query for that, completing our query. The result of
272272
this query would then be:
273273

274-
275274
```json
276275
{
277276
"hero": {
@@ -397,7 +396,7 @@ which will give us the nested response
397396
```
398397

399398
The `Query` type above defined a way to fetch a human given their
400-
ID. We can use it by hardcoding the ID in the query:
399+
ID. We can use it by hard-coding the ID in the query:
401400

402401
```graphql
403402
query FetchLukeQuery {
@@ -608,7 +607,7 @@ on runtime checks.
608607

609608
For our Star Wars example, the file
610609
[starWarsValidationTests.js](https://github.com/graphql/graphql-js/blob/main/src/__tests__/starWarsValidation-test.js)
611-
contains a number of queries demonstrating various invalidities, and is a test
610+
contains a number of demonstrations of invalid operations, and is a test
612611
file that can be run to exercise the reference implementation's validator.
613612

614613
To start, let's take a complex valid query. This is the `NestedQuery` example

cspell.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: en-US
2+
ignoreRegExpList:
3+
# Posessives
4+
- /[a-z]{2,}'s/
5+
words:
6+
# Terms of art
7+
- endianness
8+
- interoperation
9+
- monospace
10+
- openwebfoundation
11+
- parallelization
12+
- structs
13+
- subselection
14+
# Fictional characters / examples
15+
- alderaan
16+
- hagrid
17+
- leia
18+
- newhope
19+
- othername
20+
- skywalker
21+
- tatooine
22+
- zuck
23+
- zuckerberg

package-lock.json

Lines changed: 1639 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
"url": "http://github.com/graphql/graphql-spec.git"
1414
},
1515
"scripts": {
16-
"test": "spec-md spec/GraphQL.md > /dev/null",
16+
"test": "npm run test:build && npm run test:spellcheck",
17+
"test:build": "spec-md spec/GraphQL.md > /dev/null",
18+
"test:spellcheck": "cspell 'spec/**/*.md' README.md",
1719
"build": "mkdir -p out; spec-md --githubSource 'https://github.com/graphql/graphql-spec/blame/main/' spec/GraphQL.md > out/index.html",
1820
"watch": "nodemon -e json,md --exec 'npm run build'"
1921
},
2022
"devDependencies": {
23+
"cspell": "5.3.12",
2124
"nodemon": "2.0.7",
2225
"spec-md": "3.0.2"
2326
}

spec/Appendix A -- Notation Conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ and their expanded definitions in the context-free grammar.
8484
A grammar production may specify that certain expansions are not permitted by
8585
using the phrase "but not" and then indicating the expansions to be excluded.
8686

87-
For example, the following production means that the nonterminal {SafeWord} may
87+
For example, the following production means that the non-terminal {SafeWord} may
8888
be replaced by any sequence of characters that could replace {Word} provided
8989
that the same sequence of characters could not replace {SevenCarlinWords}.
9090

spec/Section 2 -- Language.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ For example in this operation using the Facebook data model:
621621

622622
```graphql example
623623
query FragmentTyping {
624-
profiles(handles: ["zuck", "cocacola"]) {
624+
profiles(handles: ["zuck", "coca-cola"]) {
625625
handle
626626
...userFragment
627627
...pageFragment
@@ -654,7 +654,7 @@ will be present and `friends` will not.
654654
"friends": { "count": 1234 }
655655
},
656656
{
657-
"handle": "cocacola",
657+
"handle": "coca-cola",
658658
"likers": { "count": 90234512 }
659659
}
660660
]
@@ -673,7 +673,7 @@ example. We could accomplish the same thing using inline fragments.
673673

674674
```graphql example
675675
query inlineFragmentTyping {
676-
profiles(handles: ["zuck", "cocacola"]) {
676+
profiles(handles: ["zuck", "coca-cola"]) {
677677
handle
678678
... on User {
679679
friends {

0 commit comments

Comments
 (0)