Add static analysis to the CI build

This commit is contained in:
hugovk 2014-03-08 11:16:41 +02:00
parent 2254430b39
commit bd9f658de8
5 changed files with 24 additions and 4 deletions

View file

@ -3,8 +3,9 @@ python:
- '2.7'
- '3.3'
install:
- pip install -r requirements.txt
- pip install -r test_requirements.txt
- pip install coveralls
before_script: ./check.sh
script: coverage run --source=pylast ./test_pylast.py
after_success:
coveralls

View file

@ -89,7 +89,7 @@ export PYLAST_API_SECRET=TODO_ENTER_YOURS_HERE
To run all:
```
pip install pyyaml
pip install -r test_requirements.txt
./test_pylast.py
```
@ -105,9 +105,13 @@ Or all those tests matching a term:
To run with coverage:
```
pip install coverage
coverage run --source=pylast ./test_pylast.py
coverage report # for command-line report
coverage html # for HTML report
open htmlcov/index.html
```
To perform some static analysis:
```
./check.sh
```

11
check.sh Executable file
View file

@ -0,0 +1,11 @@
pyflakes pylast.py
echo ---
pyflakes test_pylast.py
echo ---
pep8 test_pylast.py
echo ---
pep8 pylast.py
echo ---
clonedigger --cpd-output pylast.py
grep "Clones detected" output.html
grep "lines are duplicates" output.html

View file

@ -1 +0,0 @@
pyyaml

5
test_requirements.txt Normal file
View file

@ -0,0 +1,5 @@
clonedigger
coverage
pep8
pyyaml
pyflakes