fix pylint configuration 31/93731/2
authorguillaume.lambert <guillaume.lambert@orange.com>
Fri, 4 Sep 2020 08:52:02 +0000 (10:52 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Tue, 10 Nov 2020 15:10:42 +0000 (16:10 +0100)
- modify the method regex used:
  Tests methods name are commonly above the default limit of 32 char.
  They also use capital letters here to abide by the OpenROADM and WDM
  naming conventions.
- modify the variable regex used:
  It was supporting by default only the snake case and reported
  camel case variables as errors.
  Variable names also use capital letters here to abide by the OpenROADM
  and WDM naming conventions.
- disable the no-member check (inline):
  it reports many false positives since pylint is unable to retrieve
  the HTTP return codes given in the request package dictionary
- disable the too-many-public-methods check (inline):
  it reports many false positives since unittests requires many public
  methods

JIRA: TRNSPRTPCE-320
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I21686442628591fd2c4af5182dc9f438e5701cb2
(cherry picked from commit eb62dcae252d4ca82e7308b575c9babdbade868d)

21 files changed:
tests/transportpce_tests/1.2.1/test_end2end.py
tests/transportpce_tests/1.2.1/test_gnpy.py
tests/transportpce_tests/1.2.1/test_olm.py
tests/transportpce_tests/1.2.1/test_pce.py
tests/transportpce_tests/1.2.1/test_portmapping.py
tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py
tests/transportpce_tests/1.2.1/test_topoPortMapping.py
tests/transportpce_tests/1.2.1/test_topology.py
tests/transportpce_tests/2.2.1/test_end2end.py
tests/transportpce_tests/2.2.1/test_olm.py
tests/transportpce_tests/2.2.1/test_otn_end2end.py
tests/transportpce_tests/2.2.1/test_otn_renderer.py
tests/transportpce_tests/2.2.1/test_otn_sh_renderer.py
tests/transportpce_tests/2.2.1/test_otn_topology.py
tests/transportpce_tests/2.2.1/test_portmapping.py
tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py
tests/transportpce_tests/2.2.1/test_tapi.py
tests/transportpce_tests/2.2.1/test_topoPortMapping.py
tests/transportpce_tests/2.2.1/test_topology.py
tests/transportpce_tests/common/test_utils.py
tox.ini

index 0e8e3041106a88292fa3ad8e78f6f95de023de3b..2499cf5c28e1af0a52bcf962d909adad3bcae010 100644 (file)
@@ -8,6 +8,8 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
 
 import json
 import time
index 3b8b69be2c83f8849ab0576eaaf977bb06185bc7..6ca4dbdf2b406828cea842378f6de5ffb25d9b79 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import json
 import os
index b0711ab1b8767aafd3c127be03882bfb6a01c66b..3315a049eed551098445b4eca0ffa23d1bffcbc9 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 #############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import time
 import json
index 48a0fe9e0a12859fe364053aac77340b573b78cc..0d0be80dee25c51ca59cf717f5ebaec4cc5b48ef 100644 (file)
@@ -8,6 +8,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import json
 import os
index 9bfeb4840f6bec7ef00731ad30fe6096f950f7b5..b6cbf101d0f3bfe3bf6a4b9cb805efb42a6a5fdc 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import time
 import requests
index 898cf34384aeecc504e2ceab58f2c1a28c9e1d9b..d21678abdad8a0e0a3b58b9b9c20a2d0b0c94ff1 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 #############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import json
 import time
index 1c3ef934c80864f6871d966a06fa00bc759d6b81..f1a460103811268d2b8a0c48bbfb7aecbc2ccdd7 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import time
 import unittest
 import requests
index ab9419def459e1fc99eed77afc69cc22fd41bee7..87423ca6eda613c53121ac6d964b6b62f73d8908 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import json
 import time
 import unittest
index 5e8cc9820bb37f73d307cee79c44e85d95799a4a..eb13111b1afab05cfeabe85b59cd6fad71774839 100644 (file)
@@ -8,6 +8,8 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
 
 import unittest
 import json
index c470283e21c4af12fbad31f49b423b083bf88654..a09a1e65ff6251c18d7d13c008b8caf061762735 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 #############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import time
 import json
index 5602bff005e80d83d9fe1a2ca15d872f8565d398..1fd95ae61942cd79918546840cf58baf2a01fbd5 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import time
 import requests
index a854d11fa16f0b927c14da4675ce7b00ebe9832d..1bfa72043e4397178ffd945e9952f0918e86a7a2 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import json
 import time
index 2ec03efa73c69322008038550595d53e11a9ca89..be4c5e7a71d851fef07bdd8b552f9bb78244c973 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import time
 import requests
index 91045e501d20e89bb31baaf9b02abfa1a8dabe37..e4f5c8d6865b8c3ea715cfb0d7c4ce5ed0d3c57a 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import time
 import logging
index d84aa8ffa7262c58d92945d998ce19de13ba8a6b..68b73e14f506e5bbd68f92d225c2add44fa67c31 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import time
 import requests
index 12f7c09830864fd82eeb0bed139edb5e0b8bc9e9..cb42de3095e27ee8f33fda2bebdbbbd582dd3b05 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 #############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import json
 #from unittest.result import failfast
index 9467034383e8a8feb51d7db1c7c506b72975b072..f94b5a50f103ebe520d0dafe8c7a466d38a7dffa 100644 (file)
@@ -7,6 +7,10 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
+
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import os
 import sys
 import time
index d60aac9b472c52a5a9b39462eab1ba003c14b825..14e258d553d16c8a358a30464815a8757cce563f 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import json
 import time
index 3d8cf50dfa24da8ac6662e0baf2f2fbdf560cc58..718440b23d9062f90e198909c0873f7ce77701d3 100644 (file)
@@ -9,6 +9,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# pylint: disable=no-member
+# pylint: disable=too-many-public-methods
+
 import unittest
 import time
 import json
index 3a2d6e9ea2936b0684dca000ddc2ad41ff166e70..6f331742d20bdfd63ca158bd0126c6f4cdd4eecd 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+
 ##############################################################################
 # Copyright (c) 2020 Orange, Inc. and others.  All rights reserved.
 #
@@ -7,6 +8,9 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
+
+# pylint: disable=no-member
+
 import json
 import os
 import sys
diff --git a/tox.ini b/tox.ini
index 6aee9f78424503bde276259f9fc4bc126846f87a..eee1ad8d4fa8032b1d6c6b76009892404ab5f9a4 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -84,4 +84,4 @@ basepython = python3
 deps = pylint
 whitelist_externals = find
 commands =
-    find transportpce_tests/ -name *.py -exec pylint --max-line-length=120 --disable=missing-docstring  --reports=y --score=y  --output-format=colorized  \{\} +
+    find transportpce_tests/ -name *.py -exec pylint --max-line-length=120 --disable=missing-docstring --method-rgx="(([a-z_][a-zA-Z0-9_]{2,})|(_[a-z0-9_]*)|(__[a-zA-Z][a-zA-Z0-9_]+__))$" --variable-rgx="[a-zA-Z_][a-zA-Z0-9_]{1,30}$" --reports=y --score=y  --output-format=colorized  \{\} +