Skip to content

Commit

Permalink
Reconfigure cspell to use dictionaries (Qiskit#873)
Browse files Browse the repository at this point in the history
Closes Qiskit#827
  • Loading branch information
kaelynj authored Feb 23, 2024
1 parent f6ffdf6 commit 7badbc3
Show file tree
Hide file tree
Showing 6 changed files with 307 additions and 288 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
285 changes: 0 additions & 285 deletions cSpell.json

This file was deleted.

57 changes: 57 additions & 0 deletions cspell/cSpell.json
Original file line number Diff line number Diff line change
@@ -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*"
]
}
Loading

0 comments on commit 7badbc3

Please sign in to comment.