瀏覽代碼

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 7 年之前
父節點
當前提交
3514301908
沒有帳戶連結到提交者的電子郵件
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      .travis.yml

+ 6
- 1
.travis.yml 查看文件

@@ -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