From aba0adfd3bf450927e9ee679fff3d8cbecb66ce6 Mon Sep 17 00:00:00 2001 From: "guillaume.lambert" Date: Fri, 4 Sep 2020 10:52:02 +0200 Subject: [PATCH] fix pylint configuration - 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 Change-Id: I21686442628591fd2c4af5182dc9f438e5701cb2 (cherry picked from commit eb62dcae252d4ca82e7308b575c9babdbade868d) --- tests/transportpce_tests/1.2.1/test_end2end.py | 2 ++ tests/transportpce_tests/1.2.1/test_gnpy.py | 3 +++ tests/transportpce_tests/1.2.1/test_olm.py | 3 +++ tests/transportpce_tests/1.2.1/test_pce.py | 3 +++ tests/transportpce_tests/1.2.1/test_portmapping.py | 3 +++ .../1.2.1/test_renderer_service_path_nominal.py | 3 +++ tests/transportpce_tests/1.2.1/test_topoPortMapping.py | 3 +++ tests/transportpce_tests/1.2.1/test_topology.py | 3 +++ tests/transportpce_tests/2.2.1/test_end2end.py | 2 ++ tests/transportpce_tests/2.2.1/test_olm.py | 3 +++ tests/transportpce_tests/2.2.1/test_otn_end2end.py | 3 +++ tests/transportpce_tests/2.2.1/test_otn_renderer.py | 3 +++ tests/transportpce_tests/2.2.1/test_otn_sh_renderer.py | 3 +++ tests/transportpce_tests/2.2.1/test_otn_topology.py | 3 +++ tests/transportpce_tests/2.2.1/test_portmapping.py | 3 +++ .../2.2.1/test_renderer_service_path_nominal.py | 3 +++ tests/transportpce_tests/2.2.1/test_tapi.py | 4 ++++ tests/transportpce_tests/2.2.1/test_topoPortMapping.py | 3 +++ tests/transportpce_tests/2.2.1/test_topology.py | 3 +++ tests/transportpce_tests/common/test_utils.py | 4 ++++ tox.ini | 2 +- 21 files changed, 61 insertions(+), 1 deletion(-) diff --git a/tests/transportpce_tests/1.2.1/test_end2end.py b/tests/transportpce_tests/1.2.1/test_end2end.py index dd0c9bd17..7854f06fc 100644 --- a/tests/transportpce_tests/1.2.1/test_end2end.py +++ b/tests/transportpce_tests/1.2.1/test_end2end.py @@ -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 diff --git a/tests/transportpce_tests/1.2.1/test_gnpy.py b/tests/transportpce_tests/1.2.1/test_gnpy.py index 20e7d7578..de8e19f2a 100644 --- a/tests/transportpce_tests/1.2.1/test_gnpy.py +++ b/tests/transportpce_tests/1.2.1/test_gnpy.py @@ -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 diff --git a/tests/transportpce_tests/1.2.1/test_olm.py b/tests/transportpce_tests/1.2.1/test_olm.py index b0711ab1b..3315a049e 100644 --- a/tests/transportpce_tests/1.2.1/test_olm.py +++ b/tests/transportpce_tests/1.2.1/test_olm.py @@ -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 diff --git a/tests/transportpce_tests/1.2.1/test_pce.py b/tests/transportpce_tests/1.2.1/test_pce.py index 00aab10de..4b4443bed 100644 --- a/tests/transportpce_tests/1.2.1/test_pce.py +++ b/tests/transportpce_tests/1.2.1/test_pce.py @@ -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 diff --git a/tests/transportpce_tests/1.2.1/test_portmapping.py b/tests/transportpce_tests/1.2.1/test_portmapping.py index 861d88098..6024ca236 100644 --- a/tests/transportpce_tests/1.2.1/test_portmapping.py +++ b/tests/transportpce_tests/1.2.1/test_portmapping.py @@ -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 diff --git a/tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py b/tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py index dbf11a074..33b0f3cec 100644 --- a/tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py +++ b/tests/transportpce_tests/1.2.1/test_renderer_service_path_nominal.py @@ -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 diff --git a/tests/transportpce_tests/1.2.1/test_topoPortMapping.py b/tests/transportpce_tests/1.2.1/test_topoPortMapping.py index 1c3ef934c..f1a460103 100644 --- a/tests/transportpce_tests/1.2.1/test_topoPortMapping.py +++ b/tests/transportpce_tests/1.2.1/test_topoPortMapping.py @@ -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 diff --git a/tests/transportpce_tests/1.2.1/test_topology.py b/tests/transportpce_tests/1.2.1/test_topology.py index ab9419def..87423ca6e 100644 --- a/tests/transportpce_tests/1.2.1/test_topology.py +++ b/tests/transportpce_tests/1.2.1/test_topology.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_end2end.py b/tests/transportpce_tests/2.2.1/test_end2end.py index f5013e093..e45603b68 100644 --- a/tests/transportpce_tests/2.2.1/test_end2end.py +++ b/tests/transportpce_tests/2.2.1/test_end2end.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_olm.py b/tests/transportpce_tests/2.2.1/test_olm.py index c470283e2..a09a1e65f 100644 --- a/tests/transportpce_tests/2.2.1/test_olm.py +++ b/tests/transportpce_tests/2.2.1/test_olm.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_otn_end2end.py b/tests/transportpce_tests/2.2.1/test_otn_end2end.py index ffda6a582..2d2e4f46d 100644 --- a/tests/transportpce_tests/2.2.1/test_otn_end2end.py +++ b/tests/transportpce_tests/2.2.1/test_otn_end2end.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_otn_renderer.py b/tests/transportpce_tests/2.2.1/test_otn_renderer.py index 35262a5f5..f4ec82795 100644 --- a/tests/transportpce_tests/2.2.1/test_otn_renderer.py +++ b/tests/transportpce_tests/2.2.1/test_otn_renderer.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_otn_sh_renderer.py b/tests/transportpce_tests/2.2.1/test_otn_sh_renderer.py index 2ec03efa7..be4c5e7a7 100644 --- a/tests/transportpce_tests/2.2.1/test_otn_sh_renderer.py +++ b/tests/transportpce_tests/2.2.1/test_otn_sh_renderer.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_otn_topology.py b/tests/transportpce_tests/2.2.1/test_otn_topology.py index 91045e501..e4f5c8d68 100644 --- a/tests/transportpce_tests/2.2.1/test_otn_topology.py +++ b/tests/transportpce_tests/2.2.1/test_otn_topology.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_portmapping.py b/tests/transportpce_tests/2.2.1/test_portmapping.py index ddc4d0b06..58db3fca6 100644 --- a/tests/transportpce_tests/2.2.1/test_portmapping.py +++ b/tests/transportpce_tests/2.2.1/test_portmapping.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py b/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py index 29b0789da..e59de8c8d 100644 --- a/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py +++ b/tests/transportpce_tests/2.2.1/test_renderer_service_path_nominal.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_tapi.py b/tests/transportpce_tests/2.2.1/test_tapi.py index 01c99fb88..9622da91b 100644 --- a/tests/transportpce_tests/2.2.1/test_tapi.py +++ b/tests/transportpce_tests/2.2.1/test_tapi.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_topoPortMapping.py b/tests/transportpce_tests/2.2.1/test_topoPortMapping.py index d60aac9b4..14e258d55 100644 --- a/tests/transportpce_tests/2.2.1/test_topoPortMapping.py +++ b/tests/transportpce_tests/2.2.1/test_topoPortMapping.py @@ -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 diff --git a/tests/transportpce_tests/2.2.1/test_topology.py b/tests/transportpce_tests/2.2.1/test_topology.py index c90f0a430..0d3bb206b 100644 --- a/tests/transportpce_tests/2.2.1/test_topology.py +++ b/tests/transportpce_tests/2.2.1/test_topology.py @@ -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 diff --git a/tests/transportpce_tests/common/test_utils.py b/tests/transportpce_tests/common/test_utils.py index ee5df6997..822aab06f 100644 --- a/tests/transportpce_tests/common/test_utils.py +++ b/tests/transportpce_tests/common/test_utils.py @@ -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 6aee9f784..eee1ad8d4 100644 --- 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 \{\} + -- 2.36.6