Commits

holger krekel committed cde53ea

improved docs

Comments (0)

Files changed (4)

-0.5
+0.6
 ----------------------------------------------
 
 - initial release
-py.test plugin for checking PEP8 source code compliance using the pep8 module.
+py.test plugin for checking PEP8 source code compliance using the `pep8 module <http://pypi.python.org/pypi/pep8>`_.
 
 Usage
 ---------
     py.test --pep8
     
 to activate source code checking. Every file ending in ``.py`` will be
-discovered and checked, starting from the command line arguments::
+discovered and checked, starting from the command line arguments.
+For example, if you have a file like this::
 
-    py.test --pep8 mysourcedir # or
-    py.test --pep8 mysourcedir/somefile.py
+    # content of myfile.py
+ 
+    somefunc( 123,456)
 
-Running PEP8 checks and no other tests
----------------------------------------------
+you can run it with::
 
-You can also restrict your tests to only run "pep8" tests and not
-your other tests by typing::
+    $ py.test --pep8
+    =========================== test session starts ============================
+    platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev1
+    pep8 ignore opts: E202 E221 E222 E241 E301 E302 E401 E501 E701 W293 W391 W601 W602
+    collecting ... collected 1 items
+    
+    myfile.py F
+    
+    ================================= FAILURES =================================
+    ________________________________ PEP8-check ________________________________
+    /tmp/doc-exec-12/myfile.py:2:10: E201 whitespace after '('
+    somefunc( 123,456)
+             ^
+    /tmp/doc-exec-12/myfile.py:2:14: E231 missing whitespace after ','
+    somefunc( 123,456)
+                 ^
+    
+    ========================= 1 failed in 0.01 seconds =========================
 
-    py.test --pep8 -k pep8
-
-This will only run tests that are marked with the "pep8" keyword
-which is added for the pep8 test items added by this plugin.
-
-Looking at currently active PEP8 options
----------------------------------------------
-
-Note that in the testing header you will see the current list of default "ignores"::
-
-    pep8 ignore opts: E202 E221 E222 E241 E301 E302 E401 E501 E701 W293 W391 W601 W602
-
+Note that in the testing header you see the current list of default "ignores".
 For the meaning of these error and warning codes, see the error output
 when running against your files or checkout `pep8.py
 <https://github.com/jcrocholl/pep8/blob/master/pep8.py>`_.
     pep8options = +W293 -E200
 
 
+Running PEP8 checks and no other tests
+---------------------------------------------
+
+You can also restrict your test run to only perform "pep8" tests
+and not any other tests by typing::
+
+    py.test --pep8 -k pep8
+
+This will only run tests that are marked with the "pep8" keyword
+which is added for the pep8 test items added by this plugin.
+
 Notes
 -------------
 
 import pep8
 import py, pytest
 
-__version__ = "0.5"
+__version__ = '0.6'
 
 def pytest_addoption(parser):
     group = parser.getgroup("general")
         if pep8.ignore_code(text[:4]):
             self.ignored_errors += 1
         pep8.Checker.report_error(self, line_number, offset, text, check)
-
     name='pytest-pep8',
     description='pytest plugin to check source code against PEP8 requirements',
     long_description=open("README.txt").read(),
-    version='0.5',
+    version='0.6',
     author='Holger Krekel and Ronny Pfannschmidt',
     author_email='holger.krekel@gmail.com',
     url='http://bitbucket.org/hpk42/pytest-pep8/',
     py_modules=['pytest_pep8'],
     entry_points={'pytest11': ['pep8 = pytest_pep8']},
     install_requires=['pytest>=2.0', 'pep8', ],
-)
+)