From ae44093565a9d6d616266a84cc9c431826d24520 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 24 Sep 2018 08:31:30 +0100 Subject: [PATCH 1/3] Run free flake8 tests on all new code submissions Fixes #284 Another attempt at #99 Add [flake8](http://flake8.pycqa.org) tests to find Python syntax errors and undefined names. __E901,E999,F821,F822,F823__ are the "_showstopper_" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety. * F821: undefined name `name` * F822: undefined name `name` in `__all__` * F823: local variable name referenced before assignment * E901: SyntaxError or IndentationError * E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree --- .travis.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..3f40e467 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +group: travis_latest +language: python +cache: pip +matrix: + include: + - python: 3.7 + dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069) + sudo: required # required for Python 3.7 (travis-ci/travis-ci#9069) +install: + - pip install -r requirements.txt + - pip install flake8 +before_script: + # stop the build if there are Python syntax errors or undefined names + - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics +script: + - true # add other tests here +notifications: + on_success: change + on_failure: change # `always` will be the setting once code changes slow down From 1c3f57f4560f743f68501e628fb58d4dac7555a1 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 24 Sep 2018 08:35:34 +0100 Subject: [PATCH 2/3] pip install --upgrade pip --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3f40e467..28d37e98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ matrix: dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069) sudo: required # required for Python 3.7 (travis-ci/travis-ci#9069) install: + - pip install --upgrade pip - pip install -r requirements.txt - pip install flake8 before_script: From 045e7da15776f0f1ccf9880a6db007a4f049196e Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 1 Oct 2018 13:33:57 +0200 Subject: [PATCH 3/3] Add a build status badge to README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 50f91451..84a7cff4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # Manim Animation engine for explanatory math videos. +[![build](https://img.shields.io/travis/3b1b/manim.svg "Travis build status")](https://travis-ci.com/3b1b/manim) + + For those who want to play around with this tool, I should be upfront that I've mostly had my own use cases (i.e. 3b1b videos) in mind while building it, and it might not be the most friendly thing to get up and running. In particular, I have not done a great job tracking requirements, writing tests, and documentation, to put it euphemistically, almost exclusively takes the form of naming conventions.