Quellcode durchsuchen

Add flake8 to find syntax errors & undefined names

There is at least one print statement that is not Python 3 compatible and many undefined names which may raise NameError at runtime.  Flake8 runs in two passes: The first looks at critical issues in stop-the-build mode and the second looks at style violations in everything-is-a-warning mode.
cclauss vor 7 Jahren
Ursprung
Commit
3514301908
Es ist kein Account mit dieser Commiter-Email verbunden
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. 6
    1
      .travis.yml

+ 6
- 1
.travis.yml Datei anzeigen

@@ -20,7 +20,12 @@ before_install:
20 20
 install:
21 21
   - ./manage.sh npm_packages
22 22
   - ./manage.sh update_dev_packages
23
-  - pip install codecov
23
+  - pip install codecov flake8
24
+before_script:
25
+  # stop the build if there are Python syntax errors or undefined names
26
+  - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
27
+  # exit-zero treats all errors as warnings.  The GitHub editor is 127 chars wide
28
+  - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
24 29
 script:
25 30
   - ./manage.sh styles
26 31
   - ./manage.sh grunt_build