Reconfigure cspell to use dictionaries (#873)

Closes #827
This commit is contained in:
Kaelyn Ferris 2024-02-23 11:02:11 -05:00 committed by GitHub
parent f6ffdf6d14
commit 7badbc30db
6 changed files with 307 additions and 288 deletions

View File

@ -243,9 +243,9 @@ There are two ways to deal with cSpell incorrectly complaining about a word, suc
Ayyyyy, this is a fake description.
```
2. Add the word to the file `cSpell.json` in the `words` section. The word is not case-sensitive.
2. If the word is a name, add it to the `cspell/dictionaries/people.txt` file. If it is a scientific or quantum specific word, add it to the `cspell/dictionaries/qiskit.txt` file. If it doesn't fit in either category, add it to the `words` section in `cspell/cSpell.json`. The word is not case-sensitive.
If the word appears in multiple files, prefer the second approach to add it to `cSpell.json`.
If the word appears in multiple files, prefer the second approach to add it to one of the dictionaries or `cSpell.json`.
## Check that pages render

View File

@ -1,285 +0,0 @@
// This file is copied from IBM's closed source configuration. When updating it
// here, also update the closed source repository, or ask a maintainer to do so
// if you do not have access.
{
"version": "0.2",
"language": "en",
"allowCompoundWords": true,
"words": [
"Aaronson",
"Ahokas",
"Abelian",
"Abhari",
"Almaden",
"Alon",
"Ambainis",
"Ansatz",
"anticommute",
"anticommutes",
"arccos",
"arcsin",
"arctan",
"argsort",
"arity",
"autodifferentiation",
"ancillae",
"ancillas",
"ansatzes",
"bijective",
"Boeblingen",
"Bravyi",
"Bremner",
"Bruhat",
"Bures",
"Canonicalization",
"Capelluto",
"Chebyshev",
"Choi",
"Chong",
"CHSH",
"Chuang",
"qubit",
"qubits",
"Qiskit",
"qasm",
"Hamiltonians",
"Eigensolver",
"Eigensolvers",
"EPLG",
"Factorizers",
"exponentials",
"Hadamard",
"matplotlib",
"numpy",
"Kraus",
"unitaries",
"decomp",
"Paulis",
"Cleve",
"Trotterization",
"Trotterizations",
"Solovay",
"Kitaev",
"Cliffords",
"connectivities",
"Cuccaro",
"destabilizer",
"detuning",
"Dueck",
"Easwar",
"eigenstate",
"eigenstates",
"Eisert",
"equispaced",
"fermionic",
"Frobenius",
"Gosset",
"Gottesman",
"Gushu",
"Häner",
"Hardamard",
"Havlicek",
"Hein",
"Hiptmair",
"Hoare",
"Hoyer",
"initialised",
"initialiser",
"ints",
"Ipython",
"ipywidgets",
"Ising",
"Iten",
"Itoko",
"Javadi",
"Jurcevic",
"Ketan",
"Koenig",
"Kolkata",
"Kutin",
"Lauer",
"Margolus",
"Martonosi",
"Maslov",
"Merkel",
"Mølmer",
"Moscas",
"Motzoi",
"Moyard",
"multinomial",
"multiqubit",
"Murali",
"Nannicini",
"Nesterovs",
"Neumann",
"openqasm",
"Ourense",
"parameterizing",
"Paulihedral",
"polynomially",
"Poppler",
"Prakash",
"pygments",
"pyplot",
"Raban",
"Rebentrost",
"Renato",
"Renner",
"rescheduler",
"resynthesized",
"Roetteler",
"Rueschlikon",
"satisfiability",
"schedulable",
"Shaohan",
"Shaydulin",
"Shende",
"Shors",
"Simonetto",
"Smolin",
"Sørensen",
"struct",
"structs",
"Sutter",
"Svore",
"Symegine",
"symplectic",
"tensored",
"Theor",
"Toffoli",
"uncompiled",
"uncompute",
"uncomputed",
"unentanglement",
"unnormalized",
"Unroller",
"Vazirani",
"Vedral",
"venv",
"Watrous",
"Weyl",
"Woerner",
"Yufei",
"Zoufal",
"Mosca",
"pydot",
"qudit",
"qutrit",
"Uhrig",
"saveas",
"Tapp",
"extremal",
"Anharmonicity",
"ALAP",
"atol",
"ASPLOS",
"BFGS",
"CDKM",
"CNOT",
"stddev",
"expval",
"qsphere",
"cargs",
"cbit",
"cbits",
"opflow",
"qobj",
"ibmq",
"clbit",
"Clbits",
"cmap",
"cnots",
"coeff",
"coeffs",
"CPLEX",
"CPTP",
"creg",
"cregs",
"csdg",
"CSWAP",
"CVXPY",
"DIMACS",
"docplex",
"dtype",
"Fieldr",
"fsim",
"kwarg",
"kwargs",
"kwparams",
"lnot",
"mathbb",
"nqubits",
"paulivec",
"qarg",
"qargs",
"qreg",
"qregs",
"regs",
"xgate",
"basicaer",
"basicaererror",
"cregbundle",
"iqft",
"iswap",
"MCMT",
"MCMTV",
"ndarray",
"NISQ",
"nxpd",
"oper",
"PRNG",
"QAOA",
"rcccx",
"RCCX",
"repr",
"rtol",
"rustworkx",
"sched",
"sxdg",
"srepr",
"sympy",
"TOQM",
"uchannel",
"UCRX",
"UCRY",
"UCRZ",
"XIYY",
"ZSXX",
"qelib",
"QVSM",
"ITTL",
"QRTE",
"mathrm",
"exponentiated",
"simulable",
"resynthesizes",
"sdist"
],
"ignoreRegExpList": [
// Markdown links
"\\((.*)\\)",
// markdown code blocks. https://github.com/streetsidesoftware/vscode-spell-checker/issues/202#issuecomment-377477473
"/^\\s*```[\\s\\S]*?^\\s*```/gm",
// inline code blocks. https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex
"\\`([^\\`].*?)\\`",
// $$ ... $$ code blocks
"\\$\\$\n(?:.*\n)*?\\$\\$",
// markdown metadata block. e.g. title, description, etc.
"---\n(?:.*\n)*?---",
// words inside curly braces. e.g. {word}
"{\\w+}",
// words inside colons. e.g. :word:
":\\S+:",
// words joined by underscores. e.g. hello_world, NEW_KEY_VALUE
"\\S+_\\S+(_\\S+)*",
// separate line <span id="" /> tags
"^<span id=\\S+ />$",
"^<span id=\\S+></span>$"
],
"ignorePaths": [
// We cannot easily control these API docs since they live in other repositories.
"docs/api/qiskit/**/*.md*",
"docs/api/qiskit-ibm-runtime/**/*.md*",
"docs/api/qiskit-ibm-provider/**/*.md*"
]
}

57
cspell/cSpell.json Normal file
View File

@ -0,0 +1,57 @@
// This file is copied from IBM's closed source configuration. When updating it
// here, also update the closed source repository, or ask a maintainer to do so
// if you do not have access.
{
"version": "0.2",
"language": "en",
"allowCompoundWords": true,
"dictionaryDefinitions": [
{
"name": "qiskit",
"path": "dictionaries/qiskit.txt",
"addWords": true
},
{
"name": "people",
"path": "dictionaries/people.txt",
"addWords": true
}
],
"dictionaries": [
"qiskit",
"people",
"python",
"python-common",
"markdown",
"softwareTerms",
"scientific-terms-us"
],
"words": ["Qiskit", "qiskit"],
"ignoreRegExpList": [
// Markdown links
"\\((.*)\\)",
// markdown code blocks. https://github.com/streetsidesoftware/vscode-spell-checker/issues/202#issuecomment-377477473
"/^\\s*```[\\s\\S]*?^\\s*```/gm",
// inline code blocks. https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex
"\\`([^\\`].*?)\\`",
// $$ ... $$ code blocks
"\\$\\$\n(?:.*\n)*?\\$\\$",
// markdown metadata block. e.g. title, description, etc.
"---\n(?:.*\n)*?---",
// words inside curly braces. e.g. {word}
"{\\w+}",
// words inside colons. e.g. :word:
":\\S+:",
// words joined by underscores. e.g. hello_world, NEW_KEY_VALUE
"\\S+_\\S+(_\\S+)*",
// separate line <span id="" /> tags
"^<span id=\\S+ />$",
"^<span id=\\S+></span>$"
],
"ignorePaths": [
// We cannot easily control these API docs since they live in other repositories.
"../docs/api/qiskit/**/*.md*",
"../docs/api/qiskit-ibm-runtime/**/*.md*",
"../docs/api/qiskit-ibm-provider/**/*.md*"
]
}

View File

@ -0,0 +1,88 @@
Aaronson
Ahokas
Abelian
Abhari
Almaden
Alon
Ambainis
Boeblingen
Bravyi
Bremner
Bruhat
Bures
Capelluto
Chebyshev
Choi
Chong
Chuang
Kraus
Paulis
Solovay
Kitaev
Cleve
Cuccaro
Dueck
Easwar
Eisert
Frobenius
Gosset
Gottesman
Gushu
Häner
Hardamard
Havlicek
Hein
Hiptmair
Hoare
Hoyer
Ising
Iten
Itoko
Javadi
Jurcevic
Ketan
Koenig
Kolkata
Kutin
Lauer
Margolus
Martonosi
Maslov
Merkel
Mølmer
Moscas
Motzoi
Moyard
Murali
Nannicini
Nesterovs
Neumann
Ourense
Poppler
Prakash
Raban
Rebentrost
Renato
Renner
Roetteler
Rueschlikon
Shaohan
Shaydulin
Shende
Shors
Simonetto
Smolin
Sørensen
Sutter
Svore
Toffoli
Vazirani
Vedral
Watrous
Weyl
Woerner
Yufei
Zoufal
Mosca
Uhrig
Tapp

View File

@ -0,0 +1,159 @@
Abelian
Ansatz
anticommute
anticommutes
arccos
arcsin
arctan
argsort
autodifferentiation
ancillae
ancillas
ansatzes
bijective
Canonicalization
CHSH
qubit
qubits
Qiskit
qasm
Hamiltonians
Eigensolver
Eigensolvers
EPLG
Factorizers
exponentials
Hadamard
matplotlib
numpy
unitaries
decomp
Trotterization
Trotterizations
Cliffords
connectivities
destabilizer
detuning
eigenstate
eigenstates
equispaced
fermionic
initialised
initialiser
ints
Ipython
ipywidgets
multinomial
multiqubit
openqasm
parameterizing
Paulihedral
polynomially
pygments
pyplot
rescheduler
resynthesized
satisfiability
schedulable
struct
structs
Symegine
symplectic
tensored
uncompiled
uncompute
uncomputed
unentanglement
unnormalized
Unroller
venv
pydot
qudit
qutrit
saveas
extremal
Anharmonicity
ALAP
atol
ASPLOS
BFGS
CDKM
CNOT
stddev
expval
qsphere
cargs
cbit
cbits
opflow
qobj
ibmq
clbit
Clbits
cmap
cnots
coeff
coeffs
CPLEX
CPTP
creg
cregs
csdg
CSWAP
CVXPY
DIMACS
docplex
dtype
Fieldr
fsim
kwarg
kwargs
kwparams
lnot
mathbb
nqubits
paulivec
qarg
qargs
qreg
qregs
regs
xgate
basicaer
basicaererror
cregbundle
iqft
iswap
MCMT
MCMTV
ndarray
NISQ
nxpd
oper
PRNG
QAOA
rcccx
RCCX
repr
rtol
rustworkx
sched
sxdg
srepr
sympy
TOQM
uchannel
UCRX
UCRY
UCRZ
XIYY
ZSXX
qelib
QVSM
ITTL
QRTE
mathrm
exponentiated
simulable
resynthesizes
sdist"

View File

@ -8,7 +8,7 @@
"check": "npm run check:metadata && npm run check:spelling && npm run check:links && npm run check:fmt",
"check:metadata": "node -r esbuild-register scripts/commands/checkMetadata.ts",
"check:links": "node -r esbuild-register scripts/commands/checkLinks.ts",
"check:spelling": "cspell --relative --no-progress docs/**/*.md* docs/api/**/*.md*",
"check:spelling": "cspell --relative --no-progress docs/**/*.md* docs/api/**/*.md* --config cspell/cSpell.json",
"check:fmt": "prettier --check .",
"check-pages-render": "node -r esbuild-register scripts/commands/checkPagesRender.ts",
"fmt": "prettier --write .",