Add static analysis to the CI build
This commit is contained in:
parent
2254430b39
commit
bd9f658de8
|
@ -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
|
||||
|
|
|
@ -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
11
check.sh
Executable 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
|
|
@ -1 +0,0 @@
|
|||
pyyaml
|
5
test_requirements.txt
Normal file
5
test_requirements.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
clonedigger
|
||||
coverage
|
||||
pep8
|
||||
pyyaml
|
||||
pyflakes
|
Loading…
Reference in a new issue