Skip to main content

Inspektor python code checker and fixer

Project description

Inspektor
=========

Inspektor is a program used to verify the code of your python project. It
evolved from a set of scripts used to check patches and code of python projects
of the autotest organization [1]. As the project grew and new modules started
to be developed, we noticed the same scripts had to be copied to each new
project repo, creating a massive headache when we needed to update said
scripts.

Inspektor knows how to:

1) Check code with the help of `pylint`.
2) Check indentation of your code with the help of `pycodestyle`,
correcting it if you so deem appropriate.
3) Check whether your code is PEP8 compliant, correcting it if necessary
(only works if you have `autopep8` installed) if you so deem appropriate.
4) If your project is hosted on the autotest github area, it can apply pull
requests made against it, and check if it introduced any regression from
the metrics outlined above.

This all assumes you're working on a version control checkout of your code.
Currently inspektor knows how to handle subversion and git.

Installing inspektor
--------------------

You can get inspektor through pip:

::

$ sudo pip install inspektor

But you should avoid doing that if possible. A virtual environment deployment
tends to be better, since each installation is restricted to each environment:

::

$ virtualenv .venv
$ source .venv/bin/activate
$ pip install inspektor

If you are developing inspektor, you can install it in your virtual environment
as an editable package. From this source code tree root:

::

$ pip install -e .

Usage
-----

1) Go to the root of your project source code clone
2) If you want to check code with pylint:

::

inspekt lint
3) If you want to check indentation:

::

inspekt indent
4) If you want to check compliance to the PEP8:

::

inspekt style
5) If you want to check PR #123 for a project inside the autotest github area:

::

inspekt github 123

[1] http://autotest.github.io/

Project details


Download files

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

Source Distribution

inspektor-0.5.0.tar.gz (33.6 kB view details)

Uploaded Source

File details

Details for the file inspektor-0.5.0.tar.gz.

File metadata

  • Download URL: inspektor-0.5.0.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for inspektor-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b4500cfb2e3d0bc6af447013a6791c0fd33c5dbbe0cff880b2de50f2c849be5d
MD5 45fd749469d8dc1696ad37de13e74748
BLAKE2b-256 4552e6eb6140ca79e80a7952efd048992933466141d5e74ed2d315d8954f2470

See more details on using hashes here.

Supported by

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