Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

C Code Spell Correction

Context aware spelling check of comments and string literals in C/C++ source code files. Operation is non-interactive to facilitate operations on an existing large code base.

  1. First pass to collect terms from source code and propose corrections to comments.
$ ./cspell --out-dict code.dic --out-corrections fix.json code.c ...
  1. Edit candiate corrections in fix.json.

  2. Apply corrections

$ ./cspell --add-dict code.dic --corrections fix.json --modify code.c ...

The argument -f/--inputs reads a list of source files from a file.

Operation

cspell separates string literals and C/C++ comments from code. Tokens/terms found in code are automatically excluding from spell check.

So in the following, myfunc(), thearg, and retval will not be flagged as spelling errors.

/** Copyright 2021 Michael Davidsaver
*  Who can't spelll rite
*/
#include <stdio.h>
/** @brief special
 * @param thearg is the argument
 */
void myfunc(int thearg) {
    // myfunc() is a functon on thearg and retval
    int retval = thearg;
    if(thearg==42)
        printf("thearg is amagic value\n");
    /* another commment */
    return retval;
}

Metadata

Release files for cspell 0.0.1a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cspell 0.0.1a1
File Size Uploaded
cspell-0.0.1a1.tar.gz 6.3 kB Details

Release files / cspell-0.0.1a1.tar.gz

Download URL cspell-0.0.1a1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8ac6ea3b878e1261ddcd34dd04066f4ff0a23503996aabcecb8ecfb69c4c691e
BLAKE2b-256 checksum
How to use checksums
5d2d3ab66db6acaddbe275e67892660fbc52e89d2cff1308deea01dde3471a17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.1a1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page