|
|
@@ -1,9 +1,20 @@
|
|
1
|
1
|
#/usr/bin/env bash
|
|
|
2
|
+#
|
|
|
3
|
+# Run static analysis of the codebase
|
|
|
4
|
+#
|
|
|
5
|
+# This is run on Travis to ensure that pull requests conform to the project coding standards.
|
|
2
|
6
|
|
|
3
|
|
-ERRORFILE="violations.txt"
|
|
4
|
|
-THRESHOLD=862
|
|
|
7
|
+# Ideally, this figure should be < 100. I'll keep reducing it as the
|
|
|
8
|
+# codebase gets tidied up incrementally.
|
|
|
9
|
+THRESHOLD=795
|
|
|
10
|
+
|
|
|
11
|
+# Some warnings aren't worth worrying about...
|
|
5
|
12
|
IGNORE="W292,E202"
|
|
6
|
13
|
|
|
|
14
|
+# Run flake8 and convert the output into a format that the "violations" plugin
|
|
|
15
|
+# for Jenkins/Hudson can understand. Ignore warnings from migrations we we don't
|
|
|
16
|
+# really care about those.
|
|
|
17
|
+ERRORFILE="violations.txt"
|
|
7
|
18
|
flake8 --ignore=$IGNORE oscar | perl -ple "s/: /: [E] /" | grep -v migrations > $ERRORFILE
|
|
8
|
19
|
|
|
9
|
20
|
# Check that the number of violations is acceptable
|