Coder Social home page Coder Social logo

misspell-check's Introduction

misspellings

Build status

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.

You can review coverage of added tests by running coverage run setup.py test and then running coverage report -m.

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

The packaged version is available via pip or easy_install as misspellings. The project page is on pypi:

The source code is available in the following locations:

Pull requests on any of those platforms or emailed patches are fine.

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 sed flag. Have it support sed -i optionally, have it output all unambiguous sed commands, have it be more careful on what it replaces. It might also be an idea to have a perl output option.
  • Use generators to allow finding errors as you go. Currently misspellings grabs all files first, then checks them, which can take a while.
  • Lacking tests for misspellings cli.
  • Support UTF8: lyda#16

Credits

misspell-check's People

Contributors

lyda avatar myint avatar scop avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.