From 3fd0fd28a38bbe1fda128a85ef6226d8e3b1105e Mon Sep 17 00:00:00 2001 From: "zhen.chen" Date: Tue, 19 Oct 2021 18:20:33 +0800 Subject: [PATCH] ci: upgrade pylint to "v2.11.1" in pre-commit check related pylint issues: unsubscriptable-object: https://github.com/PyCQA/pylint/issues/5189 no-value-for-parameter: https://github.com/PyCQA/pylint/issues/2778 PR Closed: https://github.com/Graviti-AI/tensorbay-python-sdk/pull/1059 --- docs/code/BSTLD.py | 1 + docs/code/CADC.py | 1 + docs/code/DogsVsCats.py | 1 + docs/code/LeedsSportsPose.py | 1 + docs/code/NeolixOD.py | 1 + docs/code/Newsgroups20.py | 1 + docs/code/THCHS30.py | 1 + docs/code/VOC2012Segmentation.py | 1 + docs/code/cache.py | 3 +++ docs/code/cloud_storage.py | 2 +- docs/code/getting_started_with_tensorbay.py | 2 ++ docs/code/merge_datasets.py | 1 + requirements_linter.txt | 3 +-- tensorbay/dataset/segment.py | 2 +- tensorbay/geometry/polygon.py | 2 +- tensorbay/geometry/polyline.py | 2 +- tensorbay/healthcheck/report.py | 2 +- tensorbay/opendataset/LeedsSportsPose/loader.py | 1 + tensorbay/sensor/sensor.py | 5 +---- 19 files changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/code/BSTLD.py b/docs/code/BSTLD.py index b1e860088..773566a86 100644 --- a/docs/code/BSTLD.py +++ b/docs/code/BSTLD.py @@ -11,6 +11,7 @@ # pylint: disable=pointless-string-statement # pylint: disable=invalid-name # pylint: disable=unused-import +# pylint: disable=unsubscriptable-object # flake8: noqa: F401 """This file includes the python code of BSTLD.rst and read_dataset_class.rst.""" diff --git a/docs/code/CADC.py b/docs/code/CADC.py index 4b7b315f1..5581ce7c1 100644 --- a/docs/code/CADC.py +++ b/docs/code/CADC.py @@ -10,6 +10,7 @@ # pylint: disable=import-error # pylint: disable=pointless-string-statement # pylint: disable=invalid-name +# pylint: disable=unsubscriptable-object """This file includes the python code of CADC.rst.""" diff --git a/docs/code/DogsVsCats.py b/docs/code/DogsVsCats.py index d2583afcd..362fb0714 100644 --- a/docs/code/DogsVsCats.py +++ b/docs/code/DogsVsCats.py @@ -11,6 +11,7 @@ # pylint: disable=pointless-string-statement # pylint: disable=invalid-name # pylint: disable=unused-import +# pylint: disable=unsubscriptable-object # flake8: noqa: F401 """This files includes the python code example in dogsvscats.rst.""" diff --git a/docs/code/LeedsSportsPose.py b/docs/code/LeedsSportsPose.py index 39824d1dd..301d2d677 100644 --- a/docs/code/LeedsSportsPose.py +++ b/docs/code/LeedsSportsPose.py @@ -11,6 +11,7 @@ # pylint: disable=pointless-string-statement # pylint: disable=invalid-name # pylint: disable=unused-import +# pylint: disable=unsubscriptable-object # flake8: noqa: F401 """This file includes the python code of LeedsSportsPose.rst.""" diff --git a/docs/code/NeolixOD.py b/docs/code/NeolixOD.py index 1bc60e642..8f0c0668a 100644 --- a/docs/code/NeolixOD.py +++ b/docs/code/NeolixOD.py @@ -11,6 +11,7 @@ # pylint: disable=pointless-string-statement # pylint: disable=invalid-name # pylint: disable=unused-import +# pylint: disable=unsubscriptable-object # flake8: noqa: F401 """This file includes the python code of NeolixOD.rst.""" diff --git a/docs/code/Newsgroups20.py b/docs/code/Newsgroups20.py index 7dc8492ff..89a62b2f4 100644 --- a/docs/code/Newsgroups20.py +++ b/docs/code/Newsgroups20.py @@ -11,6 +11,7 @@ # pylint: disable=pointless-string-statement # pylint: disable=invalid-name # pylint: disable=unused-import +# pylint: disable=unsubscriptable-object # flake8: noqa: F401 """This file includes the python code of NewsGroups.rst and read_dataset_class.rst.""" diff --git a/docs/code/THCHS30.py b/docs/code/THCHS30.py index 765647bb9..e013fa8dd 100644 --- a/docs/code/THCHS30.py +++ b/docs/code/THCHS30.py @@ -11,6 +11,7 @@ # pylint: disable=pointless-string-statement # pylint: disable=invalid-name # pylint: disable=unused-import +# pylint: disable=unsubscriptable-object # flake8: noqa: F401 """This file includes the python code of THCHS.rst and read_dataset_class.rst.""" diff --git a/docs/code/VOC2012Segmentation.py b/docs/code/VOC2012Segmentation.py index 32a5eddac..f4ce6fbd0 100644 --- a/docs/code/VOC2012Segmentation.py +++ b/docs/code/VOC2012Segmentation.py @@ -11,6 +11,7 @@ # pylint: disable=pointless-string-statement # pylint: disable=invalid-name # pylint: disable=unused-import +# pylint: disable=unsubscriptable-object # flake8: noqa: F401 # type: ignore[attr-defined] diff --git a/docs/code/cache.py b/docs/code/cache.py index d230a547f..bf24f87d4 100644 --- a/docs/code/cache.py +++ b/docs/code/cache.py @@ -5,6 +5,9 @@ # pylint: disable=wrong-import-position # pylint: disable=pointless-string-statement +# pylint: disable=unsubscriptable-object +# pylint: disable=invalid-name +# pylint: disable=not-an-iterable # type: ignore[arg-type] """This is the example code of using cache for online dataset.""" diff --git a/docs/code/cloud_storage.py b/docs/code/cloud_storage.py index 6a1cbc649..39fdeb22e 100644 --- a/docs/code/cloud_storage.py +++ b/docs/code/cloud_storage.py @@ -6,7 +6,7 @@ # pylint: disable=wrong-import-position # pylint: disable=wrong-import-order # pylint: disable=pointless-string-statement - +# pylint: disable=invalid-name """This file includes the python code of auth cloud storage import.""" """Get cloud client""" diff --git a/docs/code/getting_started_with_tensorbay.py b/docs/code/getting_started_with_tensorbay.py index a372ce890..bd4416287 100644 --- a/docs/code/getting_started_with_tensorbay.py +++ b/docs/code/getting_started_with_tensorbay.py @@ -9,6 +9,8 @@ # pylint: disable=ungrouped-imports # pylint: disable=import-error # pylint: disable=pointless-string-statement +# pylint: disable=not-an-iterable +# pylint: disable=invalid-name """This file includes the python code of getting_started_with_tensorbay.rst.""" diff --git a/docs/code/merge_datasets.py b/docs/code/merge_datasets.py index f0a9b2f9d..9c8f95ea1 100644 --- a/docs/code/merge_datasets.py +++ b/docs/code/merge_datasets.py @@ -7,6 +7,7 @@ # pylint: disable=wrong-import-order # pylint: disable=ungrouped-imports # pylint: disable=pointless-string-statement +# pylint: disable=invalid-name """This file includes the python code of merged_dataset.rst.""" diff --git a/requirements_linter.txt b/requirements_linter.txt index 893e278f2..081f6a199 100644 --- a/requirements_linter.txt +++ b/requirements_linter.txt @@ -4,8 +4,7 @@ # linter pre-commit -pylint == 2.7.4 -astroid == 2.5.2 +pylint == 2.11.1 pytest == 6.2.2 mock == 2.0.0 diff --git a/tensorbay/dataset/segment.py b/tensorbay/dataset/segment.py index 5311a779a..99db4673b 100644 --- a/tensorbay/dataset/segment.py +++ b/tensorbay/dataset/segment.py @@ -181,7 +181,7 @@ def _from_client(cls: Type[_FS], client: "FusionSegmentClient") -> _FS: """ # pylint: disable=protected-access segment: _FS = object.__new__(cls) - super(cls, segment).__init__(client.name) + super(cls, segment).__init__(name=client.name) # pylint: disable=no-value-for-parameter segment._client = client segment._data = client.list_frames() segment._repr_non_empty = True diff --git a/tensorbay/geometry/polygon.py b/tensorbay/geometry/polygon.py index 6cd1057aa..45e4d9ba8 100644 --- a/tensorbay/geometry/polygon.py +++ b/tensorbay/geometry/polygon.py @@ -76,7 +76,7 @@ def area(self) -> float: """ area = 0.0 - for i in range(len(self._data)): + for i in range(len(self._data)): # pylint: disable=consider-using-enumerate # pylint: disable=invalid-name x1, y1 = self._data[i - 1] x2, y2 = self._data[i] diff --git a/tensorbay/geometry/polyline.py b/tensorbay/geometry/polyline.py index d544b63d4..44fa35680 100644 --- a/tensorbay/geometry/polyline.py +++ b/tensorbay/geometry/polyline.py @@ -21,7 +21,7 @@ from tensorbay.utility import common_loads if version_info >= (3, 8): - from math import dist as _dist + from math import dist as _dist # pylint: disable=no-name-in-module else: from math import hypot diff --git a/tensorbay/healthcheck/report.py b/tensorbay/healthcheck/report.py index 9bc7236a4..978396db9 100644 --- a/tensorbay/healthcheck/report.py +++ b/tensorbay/healthcheck/report.py @@ -23,7 +23,7 @@ class Error: """Base class of healthcheck errors.""" def __str__(self) -> str: - ... + return "" class _ErrorContext: diff --git a/tensorbay/opendataset/LeedsSportsPose/loader.py b/tensorbay/opendataset/LeedsSportsPose/loader.py index db8b1c2c3..d995b18bd 100644 --- a/tensorbay/opendataset/LeedsSportsPose/loader.py +++ b/tensorbay/opendataset/LeedsSportsPose/loader.py @@ -4,6 +4,7 @@ # # pylint: disable=invalid-name # pylint: disable=missing-module-docstring +# pylint: disable=unsubscriptable-object import os diff --git a/tensorbay/sensor/sensor.py b/tensorbay/sensor/sensor.py index f9050f22d..e0778d3e2 100644 --- a/tensorbay/sensor/sensor.py +++ b/tensorbay/sensor/sensor.py @@ -101,10 +101,7 @@ class Sensor(NameMixin, TypeMixin[SensorType]): extrinsics: Transform3D - def __new__( - cls: Type[_T], - name: str, # pylint: disable=unused-argument - ) -> _T: + def __new__(cls: Type[_T], name: str) -> _T: # pylint: disable=unused-argument,arguments-differ """Create a new instance of Sensor. Arguments: