InspectR gives you insight into quality of your code at a glance. It supports variety of code quality tools.
When you add inspectr.json
file to your project directory and use command inspectr
reports from your test tools will be created and saved in RethinkDB.
You can see the reports using inspectr-dashboard, it looks like this:
Those are the ones supported now, more under way:
- flake8 python linter
- python unittests
- py.test tests
- coverage.py reports
- eslint javascript linter
- jasmine tests
- mocha tests
- karma-coverage reports
- Install Inspectr globally from pip
pip3 install inspectr
. - Start RethinkDB
docker run -d -p 8080:8080 -p 28015:28015 rethinkdb:2.3
- Add inspectr.json to your project root directory. Example:
{
"project_name": "My Project",
"rethinkdb_host": "localhost",
"rethinkdb_port": 28015,
"reporters": [
{
"type": "jasmine",
"command": "karma start karma.conf.js --single-run"
},
{
"type": "mocha",
"command": "karma start karma.conf.js --single-run"
}
]
}
- Use command
inspectr
in this directory. - Run inspectr-dashboard with RethinkDB.
- If everything went ok you should see results in browser.
- Run RethinkDB, we recommend to use docker-compose in inspectr-dashboard creates RethinkDB container.
- Add
inspectr.json
to your project root directory (example above). - Change
rethinkdb_host
andrethinkdb_port
if you have to. - Clone this repo using
git clone [email protected]:inspectr/inspectr.git.
- Build docker image, for example:
docker build -t inspectr_cli .
in inspectr directory - Run your docker image (for example:
docker run -t -v $PWD/project:/code inspectr_cli
). Give yourinspectr.json
path instead of$PWD/project
. If everything went ok report will be sent to rethinkDB and will be available in inspectr-dashboard. - If you're using RethinkDB docker container locally, and you'll see error
ConnectionRefusedError: [Errno 111] Connection refused
you have to link RethinkDB container to alias which will be use ininspectr.json
as rethinkdb_host parameter. Example:docker run -t --link inspectrdashboard_rethinkdb_1:db_link -v $PWD:/code inspectr_cli
whereinspectrdashboard_rethinkdb_1
is name of your RethinkDB container anddb_link
is parameter ofrethinkdb_host
ininspectr.json
. - Your reports should be saved in RethinkDB. Use inspectr-dashboard to see results in browser.
For more informations check FAQ at the end of README.
- Run RethinkDB
- Install Python virtual environment using, e.x. this code :
pip3 install virtualenv virtualenv env source env/bin/activate
- Install InspectR CLI to your venv
python setup.py install
- Place inspectr.json in your project directory (example above) and use command
inspectr
. - If you're inspecting JS app install (global) dependencies from docker/package.json.
- If you're inspecting python app install pip requirements from
requirements.pip
anddocker/reporter-requirements.pip
Simply go to your project and InspectR it! (remember that it must contain inspectr.json
!)
cd /path/to/my/project
inspectr
Results should be visible in InspectR Dashboard
List of reporters:
{
"project_name": "My Project",
"reporters": [
{
"type": "flake8",
"command": "flake8 apps/"
},
{
"type": "unittest",
"command": "manage.py test"
},
{
"type": "coverage-py",
"command": "coverage report"
},
{
"type": "pytest",
"command": "coverage run -m py.test"
},
{
"type": "eslint",
"command": "eslint src/"
},
{
"type": "jasmine",
"command": "karma start karma.conf.js --single-run"
},
{
"type": "mocha",
"command": "karma start karma.conf.js --single-run"
},
{
"type": "karma-coverage",
"command": null
}
]
}
-
If you have problems setting up Your RethinkDB instance, simply run it as Docker container:
docker run -d -p 8080:8080 -p 28015:28015 -p 29015:29015 rethinkdb
-
You have to run inspectr at your app first to create Collections in RethinkDB, otherwise you'll see error "Collection reports does not exist"
-
If one of your reporters will fail check if it is installed. For example if you have error
[FAIL] eslint src/ (eslint) FileNotFoundError: [Errno 2] No such file or directory: 'eslint'
```
Install eslint npm install -g eslint
- If you're inspecting django app local, install django in your virtualenv.
- If you're using Inspectr in docker and you want to connect with RethinkDB running locally (not as a container) run
docker run -t --net="host" -v $PWD/project:/code inspectr_cli