Giter Site home page Giter Site logo

tklauser / codespell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codespell-project/codespell

0.0 3.0 0.0 259 KB

check code for common misspellings

Home Page: http://www.politreco.com

License: GNU General Public License v2.0

Makefile 7.02% Python 92.36% C 0.61%

codespell's Introduction

codespell

Fix common misspellings in text files. It's designed primarily for checking misspelled words in source code, but it can be used with other files as well.

Requirements

Python 2.7 or above.

Installation

You can use pip to install codespell with e.g.:

pip install codespell

Usage

Check usage with ./codespell.py -h. There are a few command line options. Note that upon installation with "make install" we don't have the "py" suffix. We ship a dictionary that is an improved version of the one available on Wikipedia after applying them in projects like Linux Kernel, EFL, oFono among others. You can provide your own version of the dictionary, but patches for new/different entries are very welcome.

Dictionary format

The format of the dictionary was influenced by the one it originally came from, i.e. from Wikipedia. The difference is how multiple options are treated and that the last argument is the reason why a certain entry could not be applied directly, but instead be manually inspected. E.g.:

  1. Simple entry: one wrong word / one suggestion:

    calulated->calculated
  2. Entry with more than one suggested fix:

    fiel->feel, field, file, phial,

    Note the last comma! You need to use it, otherwise the last suggestion will be discarded (see below for why). When there are more than one suggestion, automatically fix is not possible and the best we can do is to give the user the file and line where the error occurred as well as the suggestions.

  3. Entry with one word, but with automatically fix disabled:

    clas->class, disabled because of name clash in c++

    Note that there isn't a comma in the end of the line. The last argument is treated as the reason why a suggestion cannot be automatically applied.

License

The Python script codespell.py is available with the following terms: (tl;dr: GPL v2)

Copyright (C) 2010-2011 Lucas De Marchi <[email protected]>

Copyright (C) 2011 ProFUSION embedded systems

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>.

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.