diff --git a/.travis.yml b/.travis.yml index 3f0deaea9..309b73e9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,8 @@ before_install: - pip install pip --upgrade - pip install git+https://github.com/timothyb89/dbuild.git - pip install google-cloud-storage + - pip install flake8 flake8-blind-except flake8-builtins flake8-pep3101 flake8-coding hacking + - pip install pylint - docker --version - docker-compose --version @@ -28,6 +30,10 @@ jobs: include: - stage: lint-shellcheck script: bash -c 'shopt -s globstar; shellcheck **/*.sh' + - stage: linting-flake8 + script: flake8 + - stage: linting-pylint + script: pylint --rcfile=setup.cfg * - stage: metrics-pipeline script: python ci.py metrics - stage: logs-pipeline diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..a468110f6 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,25 @@ +[flake8] +# D203 1 blank line required before class docstring +# H201 no 'except:' at least use 'except Exception:' +# H302 import only modules +# H405 multi line docstring summary not separated with an empty line +# E999 Invalid syntax (reported for python 3 syntax unrecognised in Python 2) +ignore = D203,H201,H302,H405,E999 +# H106: Don’t put vim configuration in source files +# H203: Use assertIs(Not)None to check for None +enable-extensions = H106,H203 +max-complexity = 50 +max-line-length = 120 +exclude =.env,.git,doc,*lib/python*,build,dist,*.egg +show-source = True +builtins = _ + +[pylint] +# C0103 Invalid %s name "%s" +# C0111 Missing %s docstring +# F0010 error while code parsing: %s +disable = C0103,C0111,F0010 +ignore = .env,.git,doc,*lib/python*,build,dist,*.egg +ignore-docstrings = yes +output-format = parseable +max-line-length = 120