Skip to content

Introducing spell checking and fixing several typos#934

Merged
bkeryan merged 48 commits intoni:masterfrom
KostaIlic2:users/kosta/cspell-one-project-dictionary
Mar 18, 2026
Merged

Introducing spell checking and fixing several typos#934
bkeryan merged 48 commits intoni:masterfrom
KostaIlic2:users/kosta/cspell-one-project-dictionary

Conversation

@KostaIlic2
Copy link
Contributor

@KostaIlic2 KostaIlic2 commented Mar 6, 2026

  • This contribution adheres to CONTRIBUTING.md.
    I have not run tests locally

  • I've updated CHANGELOG.md if applicable.

  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

I introduced configuration and dictionaries for cspell spell checker. I fixed several typos.

Why should this Pull Request be merged?

To eliminate typos present now and reduce probability of typos in the future.

What testing has been done?

I ran all static checks and generated documentation. And I ran the spell checker.
I skipped regression tests. I hope PR CI covers that.

Resolved Issues

Closes #937

Add cspell spell-checking configuration:
- cspell.json with file/path scoping and Mako template override
- cspell-dict.txt for project-specific technical terms
- cspell-ignore-words.txt for known abbreviations and API identifiers
- cspell-mako-keywords.txt for Mako template keywords

Fix spelling errors in variable, function, file names, comments,
docstrings, and test names throughout the codebase.
- Set noSuggest on all dictionaries so project-specific terms don't
  pollute suggestion lists
- Add cspell-dict and cspell-daqmx-abbreviations to the Mako template
  override so abbreviations are recognized in templates
- Merge duplicate entries in cspell-daqmx-abbreviations.txt (e.g.
  Conn # Connect / Connected / Connecting / Connector)
- Add '# Real words' section header to cspell-dict.txt
…docs

- Replace files allowlist with ignorePaths blocklist and useGitignore: true
- Add docs/**/*.rst to spell-check scope
- Add .cspell/cspell-sphinx-directives.txt dictionary for Sphinx RST directives
- Add *.rst override to apply Sphinx directives dictionary
- Add per-file dictionaries and overrides for CHANGELOG.md and CONTRIBUTING.md
- Add .cspell/cspell-changelog-words.txt with historical identifiers and bot names
- Add .cspell/cspell-contributing-words.txt with contribution workflow terms
- Add package names to cspell-dict.txt (numpy, ctypes, pytest, matplotlib, pyplot)
- Add HWCU and NIDAQ to cspell-dict.txt
- Add bitfields plural form to cspell-dict.txt
- Add backlinks to cspell-sphinx-directives.txt
- Add python dictionary to .rst override for code examples
- fix: correct domaindirectives typo in CHANGELOG.md
@KostaIlic2
Copy link
Contributor Author

Abbreviations file will need some additional work

Copy link
Collaborator

@zhindes zhindes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spot-checked everything, and it looks really nice. I don't live node in the workflow, but its not the worst, and the benefit seems good. Unless somebody knows an obvious alternative, I think I'm down. But! Let's block on Brad's review, too.

@bkeryan
Copy link
Collaborator

bkeryan commented Mar 6, 2026

Let's block on Brad's review, too.

Thanks. I will try to take a look at this later today.

@KostaIlic2 KostaIlic2 force-pushed the users/kosta/cspell-one-project-dictionary branch from 742255f to 5f0f91a Compare March 8, 2026 03:33
@KostaIlic2
Copy link
Contributor Author

KostaIlic2 commented Mar 8, 2026

@bkeryan, @mshafer-NI, @zhindes,

To reduce the number of dictionary files, I tried two alternative approaches for two markdown files - both based on inlining cspell:ignore instead of custom dictionaries.

CONTRIBUTING.md: one word per line at the top of the file — simple, easy to maintain, but adds noise before the prose.

CHANGELOG.md: one comment immediately above the line where each term is introduced — better locality, and the ignore naturally disappears if the entry is ever removed.

The trade-off vs. dictionary files is discoverability: someone maintaining the file can see exactly why a word is ignored and where it comes from, without having to cross-reference the .cspell/ folder. However, dictionary files keep all custom words in one place and don't touch the source documents.

I would appreciate your feedback on this topic. Do you have a preference between the three approaches?

... 2 days later
After some reflection, and in absence of feedback, I decided to get rid of the dictionaries for these one-off files and introduce localized cspell:ignore directives.

@KostaIlic2
Copy link
Contributor Author

KostaIlic2 commented Mar 8, 2026

We have redundancy in coverage for two markdown files for discussion purposes. After the discussion is over, I need to remove the redunancy

... 2 days later.
This is resolved.

Add .cspell/cspell-codegen-dict.txt with ~115 entries covering
NI-DAQmx initialisms, abbreviations, compound identifiers, typos
locked in public API names, and real domain words specific to
codegen and generated source files.

Update cspell.json:
- Add cspell-codegen-dict dictionary definition
- Remove broad generated/** and src/codegen/** ignore paths so
  these files are now spell-checked
- Add generated/nidaqmx/_stubs/** back to ignorePaths (protobuf
  stubs are too noisy to check)
- Add override applying cspell-codegen-dict to src/codegen/**
  and generated/**
- Sort dictionaryDefinitions alphabetically
- Order ignorePaths to match VSCode Explorer layout
- Add ordering comments to both lists

Fix typos in metadata source (src/codegen/metadata/attributes.py):
- specfied -> specified
- thermcouple -> thermocouple
- thefilter -> the filter (two occurrences)

These propagate into generated files via codegen; also fix them
directly in the generated files that are already up to date.

Minor code fixes:
- src/codegen/generator.py: docstring "Codegenerator" -> "Code generator"
- src/codegen/stub_generator.py: rename grpc_codegened_file_paths
  -> grpc_code_generated_file_paths
- Remove pyproject.toml from cspell.json ignorePaths
- Add cspell override for pyproject.toml with [cspell-dict,
  cspell-daqmx-abbreviations, python] dictionaries; the python
  dictionary covers: mypy, pypy, grpcio, tzlocal, doctest,
  filterwarnings, xfail
- Add // cspell:disable-line to the override's filename line in
  cspell.json to suppress pyproject in that string literal
- Suppress maintainer names (Hindes, Maxx, Boehme, Keryan) using
  # cspell:disable / # cspell:enable around the maintainers block
- Add # cspell:ignore addopts above [tool.pytest.ini_options].addopts
- Add # cspell:ignore testpaths above [tool.pytest.ini_options].testpaths
- Add grpcdevice and styleguide to .cspell/cspell-dict.txt
- Remove grpcdevice from .cspell/cspell-changelog-words.txt
- Remove styleguide from .cspell/cspell-changelog-words.txt and
  .cspell/cspell-contributing-words.txt
- Remove <!-- cspell:ignore styleguide --> from CONTRIBUTING.md
- Remove <!-- cspell:ignore styleguide --> and
  <!-- cspell:ignore grpcdevice --> from CHANGELOG.md
…nary

Improve comments in cspell-daqmx-api-elements.txt for consistency:
- Use specific comment taxonomy: abbreviation, unseparated words,
  unseparated initialisms, initialism, Typo, Deprecated
- Move mioDAQ to cspell-real-words.txt
- Move forcebridge/pressurebridge/torquebridge to
  cspell-project-software-terms.txt (typo: filenames should be PascalCase)
- Move installdriver to cspell-project-software-terms.txt (CLI command)
- Reclassify BBULK, COULDNT, DOESNT, DAQError, notKnown, zidx
  with accurate comments instead of 'compatibility breaking name'
forcebridge.ted → ForceBridge.ted
pressurebridge.ted → PressureBridge.ted
torquebridge.ted → TorqueBridge.ted

Update conftest.py fixtures and remove the words from the cspell dictionary.
- Remove redundant "Real word:" and "Initialism:" prefixes from comments
- Lowercase entries that are neither initialisms nor proper nouns
- Add descriptions to bare entries
- Standardize GPS initialism comments
- Correct SMIO expansion: Serial Memory I/O -> Simultaneously-sampling Multifunction I/O
This was referenced Mar 10, 2026
- Move cspell.json to .config/cspell.json
- Move .cspell/ dictionary files to .config/cspell/, dropping the
  redundant "cspell-" prefix from each filename and dictionary name
- Add globRoot: "${cwd}" so paths resolve correctly from the new location
- Set noSuggest: false on real-words to enable spelling suggestions
Copy link
Collaborator

@bkeryan bkeryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with suggestions: update PR description and CHANGELOG.md

@bkeryan bkeryan merged commit 0dfd55f into ni:master Mar 18, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change cspell.json location

4 participants