Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A tool to detect misspellings

Project Description

Spell checker for code

This is a Python library and tool to check for misspelled words in source code. It does this by looking for words from a list of common misspellings. The dictionary it uses to do this is based on the Wikipedia list of common misspellings.

The list has been slightly modified to remove some changes that cause a number of false positives. In particular ok->OK was removed (ok is frequently used in perl tests for instance).

Example

To try it out, merely run the following (using an old coreutils source tree as an example):

$ git clone git://git.sv.gnu.org/coreutils -b v8.10 coreutils
$ find coreutils -name '*.c' | misspellings -f -
coreutils/src/cat.c:754: efficency -> "efficiency"
coreutils/src/comm.c:198: funtion -> "function"
coreutils/src/expr.c:21: seperate -> "separate"
coreutils/src/pr.c:1417: accomodate -> "accommodate"
coreutils/src/tac.c:342: unneccessary -> "unnecessary"
coreutils/src/test.c:91: supressed -> "suppressed"

Contributions

Contributions are welcome! Please add unit tests for new features or bug fixes. To run all the unit tests run ./setup.py test. If you have tox installed, just run tox.

Note that tests are run on Travis for all supported python versions whenever the tree on github is pushed to.

TODO

Some items on the TODO list:

  • Implement option to interactively fix files.
  • Give some thought to supporting multiple languages?
  • Might a “common misspellings” list be different for different English users - might an American make one set of mistakes while a German writing English make another? Source of this data?
  • Fix pip upgrade bug.
  • Fix sed flag.

Credits

  • Kevin Lyda: Initial shell goo and python version.
  • myint: Better python idioms and style. Mixed case support.
    Travis support.
  • Maciej Blizinski: Potential use in opencsw pushed move to python.
  • Ville Skyttä: Sped up wordification, editor-friendly reporting.
Release History

Release History

History Node

2.0c

History Node

2.0b

This version
History Node

1.5

History Node

1.4

History Node

1.3

History Node

1.2

History Node

1.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
misspellings-1.5.tar.gz (79.4 kB) Copy SHA256 Checksum SHA256 Source Jun 10, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting