Skip to main content

Linting and Fixing Code for All Languages

Project description

https://cloud.githubusercontent.com/assets/15197846/21435381/96e50466-c89f-11e6-8f0c-95267da389cf.png

coala: Linting and fixing code for all languages

coala provides a unified command-line interface for linting and fixing all your code, regardless of the programming languages you use.

With coala, users can create rules and standards to be followed in the source code. coala has an user-friendly interface that is completely customizable. It can be used in any environment and is completely modular.

coala has a set of official bears (plugins) for several languages, including popular languages such as C/C++, Python, JavaScript, CSS, Java and many more, in addition to some generic language independent algorithms. To learn more about the different languages supported and the bears themselves, click here.

To see what coala can do for your language, run:

$ coala --show-bears --filter-by-language Python

You can generate a configuration from your command line arguments with the -s argument. Alternatively you can use coala-quickstart to generate a configuration tailored for your project.

Linux Build Status Windows Build status Scrutinizer Code Quality codecov.io Documentation Status Gitmate

Official Website

Documentation

Twitter

Facebook

Video Demo



Features

  • Out-of-the-box support for various popular languages, such as C/C++, Python, Javascript, CSS, Java and many others with built-in check routines.

  • User-friendly interfaces such as JSON, interactive CLI or any custom format.

  • Plugins for gedit, Sublime Text, Atom, Vim and Emacs.

  • Optimized performace with multi-threading to parallelize the routines - can complete a 26000 line python repository in less than 3 seconds.

  • File caching support - run only on changed files.


Installation

To install the latest stable version run:

$ pip3 install coala

Make sure you have Python >= 3.4 and pip >= 6 installed.

Stable

To install the latest development version run:

$ pip3 install coala --pre

The latest code from the master branch is automatically deployed as the development version in PyPI.

To also install all bears for coala at once run:

$ pip3 install coala-bears

You can also use cib (coala Installs Bears), which is an experimental bear manager that lets you install, upgrade, uninstall, check dependencies, etc. for bears. To install it, run:

$ pip3 install cib

For usage instructions, consult this link.

PyPI Windows Linux


Usage

There are two options to run coala:

  • using a .coafile, a project specific configuration file that will store all your settings for coala

  • using command-line arguments

Using a .coafile

A sample .coafile will look something like this:

[Spacing]
files = src/**/*.py
bears = SpaceConsistencyBear
use_spaces = True
  • The files key tells coala which files to lint - here we’re linting all python files inside the src/ directory by using a glob expression.

  • The bears key specifies which bears (plugins) you want to use. We support a huge number of languages and you can find the whole list here. If you don’t find your language there, we’ve got some bears that work for all languages. Or you can file an issue and we would create a bear for you!

  • use_spaces enforces spaces over tabs in the codebase. use_spaces is a setting for the SpaceConsistencyBear defined here.

[Spacing] is a section. Sections are executed in the order you define them.

Store the file in the project’s root directory and run coala:

$ coala

Please read our coafile specification to learn more.

Using command-line arguments

However, if you don’t want to save your settings, you can also run coala with command line arguments:

$ coala --files=setup.py --bears=SpaceConsistencyBear -S use_spaces=True

Note that this command does the same thing as having a coafile and running coala. The advantage of having a coafile is that you don’t need to enter the settings as arguments everytime.

To get the complete list of arguments and their meaning, run:

$ coala --help

You can find a quick demo of coala here:

asciicast


Awards

Awards - Yegor256 2016 Winner

Getting Involved

If you would like to be a part of the coala community, you can check out our Getting In Touch page or ask us at our active Gitter channel, where we have maintainers from all over the world. We appreciate any help!

We also have a newcomer guide to help you get started by fixing an issue yourself! If you get stuck anywhere or need some help, feel free to contact us on Gitter or drop a mail at our newcomer mailing list.

Chat on Gitter


Support

Feel free to contact us at our Gitter channel, we’d be happy to help!

You can also drop an email at our mailing list.


Authors

coala is maintained by a growing community. Please take a look at the meta information in setup.py for the current maintainers.


License

AGPL

Release history Release notifications | RSS feed

Download files

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

Source Distribution

coala-0.11.0.dev20170331204346.tar.gz (567.4 kB view details)

Uploaded Source

Built Distribution

coala-0.11.0.dev20170331204346-py34.py35.py36-none-any.whl (188.9 kB view details)

Uploaded Python 3.4 Python 3.5 Python 3.6

File details

Details for the file coala-0.11.0.dev20170331204346.tar.gz.

File metadata

File hashes

Hashes for coala-0.11.0.dev20170331204346.tar.gz
Algorithm Hash digest
SHA256 2e5bb2b94cb63de3943d463435910d35470c551843e3dc76de1f953eb8f4a749
MD5 6027a1cc731c23145e029b66670bc387
BLAKE2b-256 bf0dd7d530e39f57e8303578ec9dff34cba6ba7c86bf120af0f1657dd71a9fe5

See more details on using hashes here.

Provenance

File details

Details for the file coala-0.11.0.dev20170331204346-py34.py35.py36-none-any.whl.

File metadata

File hashes

Hashes for coala-0.11.0.dev20170331204346-py34.py35.py36-none-any.whl
Algorithm Hash digest
SHA256 619b551eb8c1dd48c48ee6af9a4d5cbdc51604fe33a0085d77a162ebb68fe028
MD5 9416ca7d880d1c8dbee64c9156cf5583
BLAKE2b-256 f4b38786ac723556ff85c9129ab69a3b25147ccf3e6cd120f82fc83edbca6dc0

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page