Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A program to check source code for mispelings...

License

NotificationsYou must be signed in to change notification settings

lyda/misspell-check

Repository files navigation

Build status

Spell checker for code

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

The list has been slightly modified to remove some changes thatcause a number of false positives. In particularok->OK wasremoved (ok is frequently used in perl tests for instance).

Example

To try it out, merely run the following (using an old coreutilssource 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 featuresor bug fixes. To run all the unit tests run./setup.py test.If you havetox installed, just runtox.

You can reviewcoverage of added tests by runningcoverage run setup.py test and then runningcoverage report -m.

Note that tests are run onTravis for all supported pythonversions whenever the tree on github is pushed to.

The packaged version is available viapip oreasy_installasmisspellings. The project page is onpypi:

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 Englishusers - might an American make one set of mistakes while a Germanwriting English make another? Source of this data?
  • Fix sed flag. Have it support sed -i optionally, have it output allunambiguous sed commands, have it be more careful on what itreplaces. It might also be an idea to have a perl output option.
  • Use generators to allow finding errors as you go. Currently misspellingsgrabs all files first, then checks them, which can take a while.
  • Lacking tests for misspellings cli.
  • Support UTF8:#16

Credits

About

A program to check source code for mispelings...

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp