diff --git a/.pycodestyle b/.pycodestyle deleted file mode 100644 index 9709441038614..0000000000000 --- a/.pycodestyle +++ /dev/null @@ -1,2 +0,0 @@ -[pycodestyle] -max-line-length = 90 diff --git a/.travis.yml b/.travis.yml index 806fc023fa6b8..4641daadd6eaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ env: - TRAVIS_CACHE=$HOME/.travis_cache/ - TRAVIS_NODE_VERSION="7.10.0" matrix: + - TOX_ENV=flake8 - TOX_ENV=javascript - TOX_ENV=pylint - TOX_ENV=py34-postgres @@ -30,5 +31,6 @@ before_script: install: - pip install --upgrade pip - pip install tox tox-travis + - pip install --upgrade flake8 - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION script: tox -e $TOX_ENV diff --git a/setup.cfg b/setup.cfg index 0236907cf4979..1e4e4f4e1bc49 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,6 +23,3 @@ detailed-errors=1 with-coverage=1 nocapture=1 cover-package=superset - -[pycodestyle] -max-line-length=90 diff --git a/tox.ini b/tox.ini index 0827ba42d52fe..17065eeae786f 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,61 @@ envlist = py35-mysql skipsdist=True +[flake8] +application-import-names = superset +exclude = + .tox + docs + superset/assets + superset/migrations + superset/templates +ignore = + C812 + E111 + E114 + E116 + E121 + E123 + E125 + E126 + E127 + E128 + E131 + E203 + E221 + E225 + E226 + E241 + E302 + E303 + E305 + E306 + E402 + E501 + E722 + E703 + E731 + E741 + F401 + F403 + F405 + F601 + F811 + F841 + I100 + I101 + I201 + I202 + Q000 + Q001 + W291 + W292 + W293 + W391 + W503 +import-order-style = google +max-line-length = 90 + [global] wheel_dir = {homedir}/.wheelhouse find_links = @@ -34,6 +89,15 @@ commands = pip install -r dev-reqs.txt {toxinidir}/run_tests.sh +[testenv:flake8] +commands = + flake8 +deps = + flake8 + flake8-commas + flake8-import-order + flake8-quotes + [testenv:javascript] commands = {toxinidir}/superset/assets/js_build.sh