]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: introduce flake8
authorMichael Fritch <mfritch@suse.com>
Tue, 26 Jan 2021 19:02:38 +0000 (12:02 -0700)
committerMichael Fritch <mfritch@suse.com>
Fri, 5 Feb 2021 18:18:17 +0000 (11:18 -0700)
Signed-off-by: Michael Fritch <mfritch@suse.com>
src/pybind/mgr/CMakeLists.txt
src/pybind/mgr/tox.ini

index 6ea957b3925bd14cd3d7caf4db01b017650f332c..679d0d9ae58ba3cf9f739cb344f89517f2706fa3 100644 (file)
@@ -6,7 +6,7 @@ if(WITH_MGR_ROOK_CLIENT)
 endif()
 if(WITH_TESTS)
   include(AddCephTest)
-  add_tox_test(mgr ${CMAKE_CURRENT_SOURCE_DIR} TOX_ENVS py3 mypy)
+  add_tox_test(mgr ${CMAKE_CURRENT_SOURCE_DIR} TOX_ENVS py3 mypy flake8)
 endif()
 
 # Location needs to match default setting for mgr_module_path, currently:
index 15e1b502fb89949577faf87b019d460393f497e0..d9597be5d9c293829fc060a742f2f78adaaf8c38 100644 (file)
@@ -4,11 +4,43 @@ envlist =
     mypy,
     test,
     fix
+    flake8
 skipsdist = true
 requires = cython
 
 [flake8]
 max-line-length = 100
+ignore =
+    E114,
+    E121,
+    E122,
+    E124,
+    E126,
+    E128,
+    E131,
+    E225,
+    E226,
+    E231,
+    E241,
+    E261,
+    E302,
+    E306,
+    E501,
+    E703,
+    E704,
+    E712,
+    E722,
+    E731,
+    E741,
+    F401,
+    F541,
+    F632,
+    F811,
+    F821,
+    F841,
+    W291,
+    W503,
+    W504,
 exclude =
     .tox,
     .vagrant,
@@ -16,6 +48,7 @@ exclude =
     *.pyc,
     templates,
     .eggs
+statistics = True
 
 [autopep8]
 addopts =
@@ -101,3 +134,14 @@ commands =
     python --version
     autopep8 {[autopep8]addopts} \
       {posargs:{[testenv:fix]modules}}
+
+[testenv:flake8]
+basepython = python3
+deps =
+    flake8
+modules =
+    cephadm
+    orchestrator
+commands =
+    flake8 --config=tox.ini {posargs} \
+      {posargs:{[testenv:flake8]modules}}