public
Description: emacs support for highighting python coverage results
Homepage:
Clone URL: git://github.com/mattharrison/pycoverage.el.git
name age message
file README Tue Oct 20 05:31:38 -0700 2009 initial commit of findtests.py [mattharrison]
directory cov2emacs/ Wed Oct 21 10:14:52 -0700 2009 found .coverage file in -w directory [mattharrison]
file pycoverage.el Tue Sep 01 13:29:01 -0700 2009 recursive lookup for .coverage files. Start in... [mattharrison]
README
pycoverage.el
=============

An emacs mode for reporting on coverage stats for python

Dependencies
============

Coverage reporter for Python:

  * coverage.py (currently we only support this)
  * figleaf (support pending)

Installation
============

Load pycoverage.el


Install cov2emacs using setuptools or virtualenv or distutils

There should be ``.coverage`` file in the directory of the module you
want coverage reporting on (or the parents of that directory).  How
you get it there is currently not solved by this tool, which only
provides a way to view the coverage data in your editor.


Flymake-mode usage
=====================

Add the following to your .emacs::
  
  (when (load "flymake" t)
    (defun flymake-pycoverage-init ()
       (list "cov2emacs" (list  "--flymake" "--python-file"  buffer-file-name))
      )
    (add-to-list 'flymake-allowed-file-name-masks
           '("\\.py\\'" flymake-pycoverage-init)))
  

Then run this on a file that has up to date coverage information for it.

  M-x flymake-mode

This will look for a ``.coverage`` file in the same directory (or the
parents) of the buffer.  And it should highlight the missing lines

Running
=======

M-x pycoverage-mode

M-x pycoverage-load-report

Ideal Usage
===========

One runs their tests using coverage.  Then they enter
``pycoverage-mode``.  That should look for a ``.coverage`` file (or
the figleaf equivalent) and load the overview/results page in another
buffer.  It will also highlight the current file (iff it's timestamp
is <= ``.coverage`` timestamp.  Newer timestamp means no guarantees on
output.) with coverage information.

Todo
====

  * Make it work!
  * Use flymake mode instead of/in combination with compile mode? - Initial Flymake DONE
  * Use missing line numbers instead of covered lines - DONE for coverage.py
  * Make pycoverage-load-report look for a ``.coverage`` file
    recursively up the parents of the file - DONE
  * Make ``cov2emacs`` accept location of ``.coverage`` file - DONE
  * Make report use normal coverage.py text output, since it's a
    little friendlier on the eyes (instead of reporting for every 
    group of lines in a file)
  * Figleaf support
  * Nose integration?

Thanks
======

  * rcov - for code to start from