-
Notifications
You must be signed in to change notification settings - Fork 41
localLandscapeIo
Landscape.io is being used to check code quality. This is a service that runs multiple python code checkers (linters) for every commit and pull request using a github hook.
The results of the cobra runs can be found at the Cobra landscape.io page.
Please see the full landscape.io documentation for more information.
These same checks can be run locally as well. landscape.io uses a python package called Prospector. This package runs pylint, pep8, pyflakes, dodgy, pep257 as well as potentially a few other optional packages. This document describes how to setup an run prospector on a local cobra repository.
- Clone the cobra repository
- Create a virtual environment
- Install prospector into the virtual environment
- Run prospector against the cobra repository
cd /directory/where/you/want/the/repository
git clone https://github.com/datacenter/cobra.git
Optionally you can switch to a different branch:
git checkout <branch-name>
How this is done depends on which tools you have installed and which version of python you are using.
mkvirtualenv <virtualenvname>
cd <dir-to-where-venv-should-go>
virtualenv <venv-name>
source <venv-name>/bin/activate
pyvenv <dir-to-where-venv-should-go>/<venv-name>
source <dir-to-where-venv-should-go>/<venv-name>/bin/activate
pip install prospector
cd /directory/where/you/want/the/repository/cobra
prospector -P /directory/where/you/want/the/repository/cobra/.landscape.yaml cobra
You can also run it against just a single file:
prospector -P /directory/where/you/want/the/repository/cobra/.landscape.yaml cobra/mit/access.py