Skip to content

Commit

Permalink
linting: make lint
Browse files Browse the repository at this point in the history
Run the pylint automatically in the project, and fail on non-compliance.
It's integrated with the checklist, but not the tests.

It remains to be checked in the CI

Fixes #22
  • Loading branch information
rmariano committed Apr 1, 2017
1 parent cd73e70 commit b3ae74e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ testdeps:
pip install -e .[tests]

.PHONY: test
test: testdeps checklist
test: testdeps
pytest

.PHONY: lint
lint:
pylint --rcfile=setup.cfg \
compressor/ \
tests/
@./tests/checklist/linting.sh

.PHONY: checklist
checklist: lint test
Expand Down
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,14 @@ And run the tests with:
.. code:: bash
make test
Before submitting a pull request, run the checklist to make sure all
dependencies are met (code style/linting, tests, pass, etc.). This is automated
with:

.. code:: bash
make checklist
This will run the checks for the code style (``make lint``), as well as the
tests (``make test``).
18 changes: 18 additions & 0 deletions tests/checklist/linting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

YELLOW="\e[93m"
RED="\e[91m"
RESET="\e[0m"
TICK="\e[32m✔"
CROSS="\e[31m✘"

echo -e "$YELLOW> Checking code style...$RESET"
pylint --rcfile=setup.cfg \
compressor/ \
tests/

if [[ "$?" == "0" ]]; then
echo -e "$TICK Code style correct$RESET"
else
echo -e "$CROSS Check for errors in the code style$RESET"
fi

0 comments on commit b3ae74e

Please sign in to comment.