Skip to main content

pylama -- Code audit tool for python

Project description

|logo| Pylama
#############

.. include:: docs/badges.rst

.. image:: https://secure.travis-ci.org/klen/pylama.png?branch=develop
:target: http://travis-ci.org/klen/pylama
:alt: Build Status

.. image:: https://coveralls.io/repos/klen/pylama/badge.png?branch=develop
:target: https://coveralls.io/r/klen/pylama
:alt: Coverals

.. image:: https://pypip.in/v/pylama/badge.png
:target: https://crate.io/packages/pylama
:alt: Version

.. image:: https://pypip.in/d/pylama/badge.png
:target: https://crate.io/packages/pylama
:alt: Downloads

.. image:: https://dl.dropboxusercontent.com/u/487440/reformal/donate.png
:target: https://www.gittip.com/klen/
:alt: Donate

Code audit tool for python. Pylama wraps these tools:

* PEP8_ © 2012-2013, Florent Xicluna;
* PyFlakes_ © 2005-2013, Kevin Watters;
* Pylint_ © 2013, Logilab;
* Mccabe_ © Ned Batchelder;


| `Pylint doesnt supported in python3.`

Docs are available at https://pylama.readthedocs.org/. Pull requests with documentation enhancements and/or fixes are awesome and most welcome.


Requirements:
=============

* Python 2.6
* Python 2.7
* Python 3.2
* Python 3.3


Instalation:
============
::

$ pip install pylama


Usage:
======

Recursive check current directory. ::

$ pylama


Ignore some errors ::

$ pylama -i W,E501


Set linters ::

$ pylama -l "pep8,mccabe"


Options
=======
::

$ pylama --help

usage: main.py [-h] [--verbose] [--format {pep8,pylint}] [--select SELECT]
[--linters LINTERS] [--ignore IGNORE] [--skip SKIP]
[--complexity COMPLEXITY] [--report REPORT] [--hook]
[--options OPTIONS]
[path]

Code audit tool for python.

positional arguments:
path Path on file or directory.

optional arguments:
-h, --help show this help message and exit
--verbose, -v Verbose mode.
--format {pep8,pylint}, -f {pep8,pylint}
Error format.
--select SELECT, -s SELECT
Select errors and warnings. (comma-separated)
--linters LINTERS, -l LINTERS
Select linters. (comma-separated)
--ignore IGNORE, -i IGNORE
Ignore errors and warnings. (comma-separated)
--skip SKIP Skip files by masks (comma-separated, Ex.
*/messages.py,*/.env)
--complexity COMPLEXITY, -c COMPLEXITY
Set mccabe complexity.
--report REPORT, -r REPORT
Filename for report.
--hook Install Git (Mercurial) hook.
--options OPTIONS, -o OPTIONS
Select configuration file. By default is
'<CURDIR>/pylama.ini'


File modeline
-------------

You can to set options for pylama inside the file. ::


.. Somethere in code
# lint_ignore=W:lint_select=W301


For disable pylama in current file: ::

.. Somethere in code
# lint=0


Skip lines
----------

Just add `# nolint` in end of line for ignore. ::

.. Somethere in code
x=d+34 # nolint


Configuration file
------------------

When starting pylama try loading configuration file. By default: `<CURDIR>/pylama.ini`,
but you set it with "-o" option.

Section `main` set a global options, like `linters` and `skip`. Other sections set
modeline options for a custom files.

Example: `pylama.ini` ::

[main]
format = pylint
skip = */.tox/*,*/.env/*
linters = pylint,mccabe

[pylama/main.py]
lint_ignore = C901,R0914,W0212
lint_select = R

[setup.py]
lint = 0


Bug tracker
-----------

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/pylama/issues


Contributing
------------

Development of adrest happens at github: https://github.com/klen/adrest


License
-------

Licensed under a **GNU lesser general public license**.

.. _PEP8: https://github.com/jcrocholl/pep8
.. _PyFlakes: https://github.com/kevinw/pyflakes
.. _Pylint: http://pylint.org
.. _Mccabe: http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html
.. |logo| image:: https://raw.github.com/klen/pylama/develop/docs/_static/logo.png

Project details


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

pylama-0.3.8.tar.gz (208.9 kB view details)

Uploaded Source

File details

Details for the file pylama-0.3.8.tar.gz.

File metadata

  • Download URL: pylama-0.3.8.tar.gz
  • Upload date:
  • Size: 208.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pylama-0.3.8.tar.gz
Algorithm Hash digest
SHA256 0c61a2aee58901e08ce60dcf29a42ae45f2809aa4cd8ac4776ab815a65a97c88
MD5 0011c17e0214a97dd0e43f1495a3a3fa
BLAKE2b-256 c6055d364c02e93d0d4684b8f25b5c4e2ff8e768630ff2a25403d16e184e7d8b

See more details on using hashes here.

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