From: Michael Fritch Date: Fri, 12 Feb 2021 15:59:07 +0000 (-0700) Subject: cephadm: introduce flake8 X-Git-Tag: v16.2.0~106^2~150 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=42fa40377d83e6e207f367cf2345e5740258b2bc;p=ceph.git cephadm: introduce flake8 Signed-off-by: Michael Fritch (cherry picked from commit 78916a499c5d8c1cef46613859152f16bdaa669f) --- diff --git a/src/cephadm/CMakeLists.txt b/src/cephadm/CMakeLists.txt index 9f2d2ab2d827..13be09bae21c 100644 --- a/src/cephadm/CMakeLists.txt +++ b/src/cephadm/CMakeLists.txt @@ -1,4 +1,4 @@ if(WITH_TESTS) include(AddCephTest) - add_tox_test(cephadm TOX_ENVS py3 mypy) + add_tox_test(cephadm TOX_ENVS py3 mypy flake8) endif() diff --git a/src/cephadm/tox.ini b/src/cephadm/tox.ini index 352277c714f3..528f75d5f97b 100644 --- a/src/cephadm/tox.ini +++ b/src/cephadm/tox.ini @@ -1,7 +1,55 @@ [tox] -envlist = py3, mypy +envlist = py3, mypy, flake8 skipsdist=true +[flake8] +max-line-length = 100 +ignore = + E117, + E121, + E122, + E123, + E124, + E125, + E126, + E127, + E128, + E131, + E201, + E203, + E225, + E226, + E231, + E241, + E251, + E261, + E265, + E266, + E301, + E302, + E303, + E305, + E306, + E402, + E501, + E703, + E722, + E741, + F401, + F841, + W291, + W293, + W503, + W504, +exclude = + .tox, + .vagrant, + __pycache__, + *.pyc, + templates, + .eggs +statistics = True + [testenv] skip_install=true deps = @@ -13,3 +61,10 @@ commands=pytest {posargs} basepython = python3 deps = mypy==0.790 commands = mypy --config-file ../mypy.ini {posargs:cephadm} + +[testenv:flake8] +basepython = python3 +deps = + flake8 +commands = + flake8 --config=tox.ini {posargs:cephadm}