Introducing spell checking and fixing several typos#934
Conversation
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
|
Abbreviations file will need some additional work |
zhindes
left a comment
There was a problem hiding this comment.
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.
Thanks. I will try to take a look at this later today. |
src/codegen/templates/library_interpreter/default_c_function_call.py.mako
Show resolved
Hide resolved
742255f to
5f0f91a
Compare
… python dict to changelog override
|
@bkeryan, @mshafer-NI, @zhindes, To reduce the number of dictionary files, I tried two alternative approaches for two markdown files - both based on inlining 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 I would appreciate your feedback on this topic. Do you have a preference between the three approaches? ... 2 days later |
|
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. |
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
…rary_interpreter.py
…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
- 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
bkeryan
left a comment
There was a problem hiding this comment.
Approved with suggestions: update PR description and CHANGELOG.md
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 requestWhat 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