Skip to content

Commit f1857dd

Browse files
committed
Add CI check for PEP 8 compliance
1 parent d22e4e7 commit f1857dd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ python:
33
- "2.7"
44
install:
55
- pip install -r requirements.txt
6+
- pip install pep8
67
script:
78
- ./scripts/cibuild.sh

scripts/cibuild.sh

+10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ if [[ ! -z $SYNTAX ]]; then
2121
EXIT=1
2222
fi
2323

24+
# Check all python source files for PEP 8 compliance, but explicitly
25+
# ignore:
26+
# - E501: line greater than 80 characters in length
27+
pep8 --ignore=E501 netbox/
28+
RC=$?
29+
if [[ $RC != 0 ]]; then
30+
echo -e "\n$(info) one or more PEP 8 errors detected, failing build."
31+
EXIT=$RC
32+
fi
33+
2434
# Prepare configuration file for use in CI
2535
CONFIG="netbox/netbox/configuration.py"
2636
cp netbox/netbox/configuration.example.py $CONFIG

0 commit comments

Comments
 (0)