From fa7aafd4c7065f00703d6f8c339804080709328f Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 20 Nov 2017 11:35:28 +0100 Subject: [PATCH 1/3] Use flake8 to look for syntax errors, undefined names --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 0bda7276d..4ef18923f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,14 +15,17 @@ os: env: - VIA=compile LC_ALL=en_US.ascii - VIA=compile + - VIA=flake8 #- VIA=pypi_nightly install: - "./travis.sh" + - pip install flake8 script: - "pip install pytest pytest-timeout" - if [[ "${VIA}" == "compile" ]]; then python -m pytest --tb=native spacy; fi + - if [[ "${VIA}" == "flake8" ]]; then flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics; fi - if [[ "${VIA}" == "pypi_nightly" ]]; then python -m pytest --tb=native --models --en `python -c "import os.path; import spacy; print(os.path.abspath(os.path.dirname(spacy.__file__)))"`; fi - if [[ "${VIA}" == "sdist" ]]; then python -m pytest --tb=native `python -c "import os.path; import spacy; print(os.path.abspath(os.path.dirname(spacy.__file__)))"`; fi From 6f42b240bc139cb7ed94c2f1189ff30c63b16580 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 20 Nov 2017 12:00:39 +0100 Subject: [PATCH 2/3] --exclude=spacy/lang to avoid flake8 infinite loop It is not clear why spacy/lang throws flake8 for a loop. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4ef18923f..120e7c6e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ install: script: - "pip install pytest pytest-timeout" - if [[ "${VIA}" == "compile" ]]; then python -m pytest --tb=native spacy; fi - - if [[ "${VIA}" == "flake8" ]]; then flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics; fi + - if [[ "${VIA}" == "flake8" ]]; then flake8 . --count --exclude=spacy/lang --select=E901,E999,F821,F822,F823 --show-source --statistics; fi - if [[ "${VIA}" == "pypi_nightly" ]]; then python -m pytest --tb=native --models --en `python -c "import os.path; import spacy; print(os.path.abspath(os.path.dirname(spacy.__file__)))"`; fi - if [[ "${VIA}" == "sdist" ]]; then python -m pytest --tb=native `python -c "import os.path; import spacy; print(os.path.abspath(os.path.dirname(spacy.__file__)))"`; fi From 2088adb0b7897a03c122de9fd617273a8c5ff56d Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 20 Nov 2017 14:00:45 +0100 Subject: [PATCH 3/3] --exclude=spacy/compat.py,spacy/lang --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 120e7c6e6..8dec277b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ install: script: - "pip install pytest pytest-timeout" - if [[ "${VIA}" == "compile" ]]; then python -m pytest --tb=native spacy; fi - - if [[ "${VIA}" == "flake8" ]]; then flake8 . --count --exclude=spacy/lang --select=E901,E999,F821,F822,F823 --show-source --statistics; fi + - if [[ "${VIA}" == "flake8" ]]; then flake8 . --count --exclude=spacy/compat.py,spacy/lang --select=E901,E999,F821,F822,F823 --show-source --statistics; fi - if [[ "${VIA}" == "pypi_nightly" ]]; then python -m pytest --tb=native --models --en `python -c "import os.path; import spacy; print(os.path.abspath(os.path.dirname(spacy.__file__)))"`; fi - if [[ "${VIA}" == "sdist" ]]; then python -m pytest --tb=native `python -c "import os.path; import spacy; print(os.path.abspath(os.path.dirname(spacy.__file__)))"`; fi