GithubHelp home page GithubHelp logo

rhcarvalho / typokiller Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 0.0 215 KB

Exterminate typos in your code base

Go 91.42% Shell 0.47% Python 8.11%
go golang typo spellcheck spelling-correction spelling-checker spell-checker python asciidoc pyenchant

typokiller's Introduction

typokiller

Exterminate typos. Now.

typokiller screenshot

typokiller is a tool for finding and fixing typos in text files, from source code comments to documentation.

Currently supported input formats:

  • Go code
  • AsciiDoc files

Planned formats:

  • Pure text files
  • Markdown
  • Python docstrings and comments
  • Wikipedia dumps
  • Diff/patch files

Project's Background Story

Since you're here, you might be interested to know how this project was born. Go on and read the story behind typokiller.

Hacking

Clone the repository:

$ git clone https://github.com/rhcarvalho/typokiller.git

Build and runtime requirements:

  • Proper Go environment (tested with Go 1.4.1, probably works with older versions)
  • Python 2.x (seems to work faster with PyPy)

It's recommended to install PyPy and use it inside a virtualenv.

Activate the virtualenv and run:

$ pip install -r requirements.txt

Build and install Go executable:

$ cd typokiller
$ go get ./...

Usage

The shortcut:

$ ./killtypos PATH ...

This will build and install typokiller, read the documentation of the Go packages in PATH(s), spellcheck it all, and present a terminal-based UI for fixing typos.

Integrate with find for great profit:

$ ./killtypos $(find /PATH/TO/GIT/REPO -type d -not \( -name .git -prune -o -name Godeps -prune \))

This will find typos in all directories under /PATH/TO/GIT/REPO (inclusive), ignoring anything under .git and Godeps.

typokiller also supports an additional format: AsciiDoc. You can use it to fix typos in documentation or generally files in the AsciiDoc format:

$ ./killtypos --format=adoc $(find /PATH/TO/GIT/REPO -type d -not \( -name .git -prune \))

You can also use the parts separately for debugging or integration with other UNIX tools:

# normal usage:
$ typokiller read /PATH/TO/GO/PKG | ./spellcheck.py | typokiller fix

# inspect spellcheck results manually:
$ typokiller read /PATH/TO/GO/PKG | ./spellcheck.py | ./pprint_json.py | less

# limit number of packages:
$ typokiller read /PATH/TO/GO/PKG | head -n 20 | ./spellcheck.py | ./pprint_json.py | less

typokiller's People

Contributors

rhcarvalho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

typokiller's Issues

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.