View on GitHub

check-spelling-docs

Documentation for check-spelling

Forbidden patterns

Included in v0.0.20

Since the spell checker has to run against all lines, there was a request to be able to reject a pattern, even though it is technically composed of valid words.

The canonical example was m_data which is apparently a macro in VxWorks that at least nasa/fprime and Qt tripped over.

But there are definitely other examples, e.g., of a deprecated API.

Implementation

I can imagine adding an extra pass right before (or after? still thinking about this) patterns.txt which looks for reject-patterns.txt / forbidden.txt that works like patterns.txt, but is run between patterns and the main spelling pass and screams if it finds matches.

Implementation details

Items in forbidden wouldn't blank things, they'd just flag separately and possibly report the specific pattern/line number that objected.

Caveats

To date, the check-spelling has not really cared which file contributed a piece of input, it just merges everything together. Remembering sources adds overhead. I'm not sure how important this would be here.

Sample consumers

m_data

Add as \bm_data\b

Javascript

Add as \bJavascript\b

MicroSoft

Both micro and soft are in the dictionary, so this will not naturally be flagged, even though it is probably problematic.

Add as \bMicroSoft\b

Duplicate words

# Reject duplicate words
\b(\w{3,})\s\g{-1}\b

FAQ | Showcase | Event descriptions | Configuration information | Known Issues | Possible features | Deprecations | Release notes | Helpful scripts