<commit_before>Coveralls for python
====================

.. image:: https://travis-ci.org/coagulant/coveralls-python.png?branch=master
    :target: https://travis-ci.org/coagulant/coveralls-python

.. image:: https://coveralls.io/repos/coagulant/coveralls-python/badge.png?branch=master
    :target: https://coveralls.io/r/coagulant/coveralls-python

`Coveralls.io`_ is service to publish your coverage stats online with a lot of `nice features`_.
This package provides seamless integration with ``coverage.py`` in your python projects.
For ruby projects, there is an `official gem`_.
Only projects hosted on Github are supported.

Works with python 2.6-2.7 and 3.3

.. _Coveralls.io: http://coveralls.io
.. _nice features: https://coveralls.io/info/features
.. _official gem: https://coveralls.io/docs/ruby

Installation
------------
First, log in via Github and `add your repo`_ on Coveralls website.

Second, install this package::

    $ pip install coveralls

If you're using `Travis CI`_, no further configuration is required.

Configuration
~~~~~~~~~~~~~

If you're not using Travis, you have to provide at least a ``repo_token`` option in ``.coveralls.yml``
at the root of your repo. This is your own secret token, which is available at the bottom of your repository's page on Coveralls.
Make sure it stays **secret**, do not put it in your public repo.

Example of .coveralls.yml::

    # .coveralls.yml
    repo_token: <KEY>

.. _add your repo: https://coveralls.io/repos/new
.. _Travis CI: http://travis-ci.org

Usage
-----
::

    $ coverage run your_test_suite_runner.py --source=yourpackagename
    $ coveralls

This will publish your coverage results on coveralls.io for everyone to see (unless you're using pro account).
Note, that example command will gather coverage for specified package.
If you wish to customise what's included in your reports, consult `coverage docs`_.

.. _coverage docs: http://nedbatchelder.com/code/coverage/

How it works
------------
It makes custom report for data generated by ``coverage.py`` package and sends it to `json API`_ of coveralls.io service.
All python files in your coverage analysis are posted to this service along with coverage stats,
so please make sure you're not ruining your own security! For private projects there is `Coveralls Pro`_.

.. _json API: https://coveralls.io/docs/api_reference
.. _Coveralls Pro: https://coveralls.io/docs/pro

Tests
-----
::

    $ python setup.py test<commit_msg>The test command has to go at the very end<commit_after>Coveralls for python
====================

.. image:: https://travis-ci.org/coagulant/coveralls-python.png?branch=master
    :target: https://travis-ci.org/coagulant/coveralls-python

.. image:: https://coveralls.io/repos/coagulant/coveralls-python/badge.png?branch=master
    :target: https://coveralls.io/r/coagulant/coveralls-python

`Coveralls.io`_ is service to publish your coverage stats online with a lot of `nice features`_.
This package provides seamless integration with ``coverage.py`` in your python projects.
For ruby projects, there is an `official gem`_.
Only projects hosted on Github are supported.

Works with python 2.6-2.7 and 3.3

.. _Coveralls.io: http://coveralls.io
.. _nice features: https://coveralls.io/info/features
.. _official gem: https://coveralls.io/docs/ruby

Installation
------------
First, log in via Github and `add your repo`_ on Coveralls website.

Second, install this package::

    $ pip install coveralls

If you're using `Travis CI`_, no further configuration is required.

Configuration
~~~~~~~~~~~~~

If you're not using Travis, you have to provide at least a ``repo_token`` option in ``.coveralls.yml``
at the root of your repo. This is your own secret token, which is available at the bottom of your repository's page on Coveralls.
Make sure it stays **secret**, do not put it in your public repo.

Example of .coveralls.yml::

    # .coveralls.yml
    repo_token: <KEY>

.. _add your repo: https://coveralls.io/repos/new
.. _Travis CI: http://travis-ci.org

Usage
-----
::

    $ coverage run --source=yourpackagename your_test_suite_runner.py
    $ coveralls

This will publish your coverage results on coveralls.io for everyone to see (unless you're using pro account).
Note, that example command will gather coverage for specified package.
If you wish to customise what's included in your reports, consult `coverage docs`_.

.. _coverage docs: http://nedbatchelder.com/code/coverage/

How it works
------------
It makes custom report for data generated by ``coverage.py`` package and sends it to `json API`_ of coveralls.io service.
All python files in your coverage analysis are posted to this service along with coverage stats,
so please make sure you're not ruining your own security! For private projects there is `Coveralls Pro`_.

.. _json API: https://coveralls.io/docs/api_reference
.. _Coveralls Pro: https://coveralls.io/docs/pro

Tests
-----
::

    $ python setup.py test
{'fraction_non_alphanumeric': 0.11983054266693564, 'fraction_numerical': 0.0024208190437764775, 'mean_word_length': 3.8135922330097087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6142506', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1405, 'n_words': 562}