MISSPELL-FIXER(1)

πŸ“¦
version 0.6 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

✨ MISSPELL-FIXER πŸ’…

okay bestie, sit down, we're talking about misspell-fixer β€” that's the manual name, the whole thing is section 1, and yes it's iconic. This little queen is a command-line utility built to automatically sniff out and correct common misspellings and typos in source code. We're talking the frequent spelling L's that show up in comments, documentation, examples, and code samples. Basically it lets you fix a ton of spelling errors across huge codebases at speeds that are frankly giving main character energy.

But listen, bestie, read this part twice: this utility does not modify file names. If a misspelled word lives in both a file's content and its name, only the content gets fixed. The file itself? You're renaming that by hand, no cap.

⚠️ Exercise extreme caution when applying corrections to public APIs, because changing spelling can introduce breaking changes for dependent systems. Like, this is the part where you do not just vibe and hit enter.

And fr fr: manual code review is always required after running this tool, to make sure your corrections didn't sneak in unintended changes or break functionality. The tool ate, but you still gotta check its homework. πŸ™ˆ

Jump to Docker usage (there's a whole section down there, iykyk)


🌸 SYNOPSIS 🌸

misspell-fixer [OPTION] target[s]

πŸŽ€ OPTIONS AND ARGUMENTS πŸŽ€

target[s] can be literally any combination of files or directories. Mix and match, she's flexible.

  • -r β€” Execute in real mode: overwrites your original files with the corrected versions. Without this option, original files stay untouched. Look but don't touch mode, default style.
  • -n β€” Disable backup creation. By default, modified files get backed up with a .$$.BAK suffix. (So if you're feeling brave... that's on you.)
  • -P n β€” Enable parallel processing using n worker processes. Example: -P 4 processes files using 4 threads. Note: the -s option is incompatible with parallel processing.
  • -f β€” Enable fast mode (equivalent to -P4).
  • -h β€” Display help information.

Performance considerations: the -s, -v options, or absence of -n or -r all utilize slower internal processing loops. For optimal performance, use -frn without -s and -v. That's the speedrun build. πŸ”₯

  • -s β€” Display diff output showing proposed changes.
  • -v β€” Enable verbose mode: display each file as it is processed (excludes prefiltering step).
  • -o β€” Enable progress mode: display processing progress (prints a dot for each scanned file, comma for each fix iteration).
  • -d β€” Enable debug mode: display detailed information about core logic steps.

By default, approximately 100 carefully selected rules are enabled. Additional rule sets can be activated using the following options:

  • -u β€” Enable less conservative rules (requires more careful manual review). Adds approximately 10 rules.
  • -g β€” Enable British English to US English conversion rules. These address regional spelling differences rather than actual errors. Adds approximately 10 rules. πŸ‡¬πŸ‡§βž‘οΈπŸ‡ΊπŸ‡Έ
  • -R β€” Enable rare misspelling rules. Adds several hundred additional rules.
  • -V β€” Enable very rare misspelling rules, primarily sourced from Wikipedia articles. Adds over 4,000 rules. 😭
  • -D β€” Enable rules derived from lintian.debian.org (git:ebac9a7). Adds approximately 2,300 rules.

Processing performance decreases with additional rule sets enabled, though modern grep implementations significantly mitigate this impact. She's still fast, don't worry.

  • -G β€” Respect .gitignore files (requires git command in PATH). This feature is experimental.
  • -N β€” Enable filename pattern filtering. Example: -N '*.cpp' -N '*.h' processes only C++ source files.
  • -i β€” Include version control system directories (process .git, .svn, .hg, CVS directories).
  • -b β€” Process binary and generated files (do not ignore *.gif, *.jpg, *.jpeg, *.png, *.zip, *.svg, *.tiff, *.gz, *.bz2, *.xz, *.rar, *.po, *.pdf, *.woff, yarn.lock, package-lock.json, composer.lock, *.mo, *.mov, *.mp4, *.jar).
  • -m β€” Disable file size filtering. Default behavior ignores files larger than 1MB (typically CSV files, minified JavaScript, etc.).

Misspell Fixer automatically excludes issues matching patterns listed in .misspell-fixer.ignore or .github/.misspell-fixer.ignore. The ignore file format follows the prefiltering temporary result format:

^filename:line number:matched word
  • -W β€” Append discovered issues to the ignore file instead of applying fixes based on other settings.
  • -w filename β€” Specify a custom ignore file path (overrides default ignore file locations).

The ignore file functions as a grep exclusion list, applied after the prefiltering step. This enables exclusion of specific prefixes or entire files. To exclude complete files, use only the filename:

^filename

To exclude an entire directory:

^directory

Path matching is based on the current invocation context. Accessing the same target via different paths from the same working directory may not apply whitelist entries consistently. For example, in directory x, whitelist entries created with target . will not apply to target ../x, despite referencing identical content. Manual editing of the whitelist file can work around this limitation. (Yeah, she's a little quirky like that. 🫢)


πŸ’€ EXIT CODES πŸ’€

The script returns exit code 0 when no typos or errors are found or fixed.

  • 0 β€” No typos detected. πŸŽ‰
  • 1-5 β€” Typos found and processed. The return value indicates the number of processing iterations executed.
  • 10 β€” Help information successfully displayed.
  • 11 β€” Whitelist file successfully saved.
  • 100+ β€” Parameter errors (invalid, missing, or conflicting options).

🌈 USAGE EXAMPLES 🌈

Check for typos without making changes (minimal output): return value can be used to detect whether it found any typos or not.

$ misspell-fixer target

Apply fixes with verbose file reporting:

$ misspell-fixer -rv target

Display proposed changes without modifying files:

$ misspell-fixer -sv target

Display changes with progress indicators and apply fixes:

$ misspell-fixer -rsv target

Maximum performance mode (fast processing, no backups):

$ misspell-fixer -frn target

Maximum performance with all rule sets enabled:

$ misspell-fixer -frunRVD target

πŸ¦‹ DATA SOURCES πŸ¦‹

This tool incorporates misspelling databases from the following sources:


🐳 DOCKER USAGE 🐳

For environments where dependency management presents challenges (macOS, Windows, legacy Linux distributions), Misspell Fixer is available as a Docker container image. Containerized queen behavior. ✨

Pull the latest container image:

$ docker pull vlajos/misspell-fixer

Process the contents of targetdir:

$ docker run -ti --rm -v targetdir:/work vlajos/misspell-fixer -frunRVD .

Standard Docker execution:

$ docker run -ti --rm -v targetdir:/work vlajos/misspell-fixer [arguments]

The targetdir becomes the working directory within the container and can be referenced as . in the arguments.

Using the included dockered-fixer wrapper script:

$ dockered-fixer [arguments]

Creating a shell function for convenience (bash/zsh):

$ function misspell-fixer { docker run -ti --rm -v $(pwd):/work vlajos/misspell-fixer "$@"; }

Using the shell function:

$ misspell-fixer [arguments]

Both the wrapper script and shell function can only access directories below the current working directory, as only the current directory is mounted as a volume in the container.

To build the container locally:

$ docker build . -t misspell-fixer

⭐ GITHUB ACTIONS INTEGRATION ⭐

A GitHub Action https://github.com/sobolevn/misspell-fixer-action is available for integrating Misspell Fixer into CI/CD workflows. The action supports automatic pull request creation with proposed fixes. Automatic PRs?? She's doing the work for you. πŸ‘‘


🧚 DEPENDENCIES 🧚

Misspell Fixer is implemented as a bash script that coordinates between established Unix utilities (mainly grep and sed). The core functionality leverages grep's -F flag for efficient parallel pattern matching using the Aho–Corasick algorithm https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm, combined with sed's targeted line modifications. Proper -w (whole word) support requires grep version 2.28 or later.

  • bash
  • find
  • sed
  • grep (version 2.28+ recommended)
  • diff
  • sort
  • tee
  • cut
  • rm, cp, mv
  • xargs
  • git (required for .gitignore file support)
  • ugrep (provides significant performance improvements when available)

πŸ‘‘ AUTHORS πŸ‘‘

  • Veres Lajos
  • ka7

πŸ’– PROJECT REPOSITORY πŸ’–

https://github.com/vlajos/misspell-fixer

This project is open source and freely available for use. Slay, and free.


okay that's the whole thing, bestie β€” this manual was dated September 2025 and signed off as misspell-fixer(), so go forth, fix those typos, back up your files, and review your diffs like the responsible main character you are πŸ’…πŸŽ€

πŸ“¦ where this page comes from