From 5d8440fdd1df803b53a4fd178d53da09359a5e77 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 28 Apr 2020 12:48:15 +0300 Subject: [PATCH] PyLint fixes --- platformio/builder/tools/piolib.py | 1 + platformio/commands/home/helpers.py | 2 +- platformio/exception.py | 2 +- platformio/managers/core.py | 2 +- platformio/managers/lib.py | 1 + platformio/managers/package.py | 2 +- platformio/telemetry.py | 4 ---- 7 files changed, 6 insertions(+), 8 deletions(-) diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index 5e61abff..3aa6b36d 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -14,6 +14,7 @@ # pylint: disable=no-member, no-self-use, unused-argument, too-many-lines # pylint: disable=too-many-instance-attributes, too-many-public-methods +# pylint: disable=assignment-from-no-return from __future__ import absolute_import diff --git a/platformio/commands/home/helpers.py b/platformio/commands/home/helpers.py index 9497e49c..018d5da6 100644 --- a/platformio/commands/home/helpers.py +++ b/platformio/commands/home/helpers.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# pylint: disable=keyword-arg-before-vararg, arguments-differ +# pylint: disable=keyword-arg-before-vararg,arguments-differ,signature-differs import os import socket diff --git a/platformio/exception.py b/platformio/exception.py index d9b5e254..905c5ab1 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -92,7 +92,7 @@ class PlatformIOPackageException(PlatformioException): pass -class UnknownPackage(PlatformIOPackageException): +class UnknownPackage(UserSideException): MESSAGE = "Detected unknown package '{0}'" diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 382e76fd..f0413d15 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -33,7 +33,7 @@ CORE_PACKAGES = { "tool-pvs-studio": "~7.7.0", } -# pylint: disable=arguments-differ +# pylint: disable=arguments-differ,signature-differs class CorePackageManager(PackageManager): diff --git a/platformio/managers/lib.py b/platformio/managers/lib.py index d85f0fa0..6e6b1b7d 100644 --- a/platformio/managers/lib.py +++ b/platformio/managers/lib.py @@ -84,6 +84,7 @@ class LibraryManager(BasePkgManager): for v in versions: semver_new = self.parse_semver_version(v["name"]) if semver_spec: + # pylint: disable=unsupported-membership-test if not semver_new or semver_new not in semver_spec: continue if not item or self.parse_semver_version(item["name"]) < semver_new: diff --git a/platformio/managers/package.py b/platformio/managers/package.py index adb9dcb5..07f2a23f 100644 --- a/platformio/managers/package.py +++ b/platformio/managers/package.py @@ -46,7 +46,7 @@ class PackageRepoIterator(object): return self def __next__(self): - return self.next() + return self.next() # pylint: disable=not-callable @staticmethod @util.memoized(expire="60s") diff --git a/platformio/telemetry.py b/platformio/telemetry.py index 396bb8e0..83c53c7f 100644 --- a/platformio/telemetry.py +++ b/platformio/telemetry.py @@ -294,10 +294,6 @@ def on_exception(e): isinstance(e, cls) for cls in (IOError, exception.ReturnErrorCode, exception.UserSideException,) ] - try: - skip_conditions.append("[API] Account: " in str(e)) - except UnicodeEncodeError as ue: - e = ue if any(skip_conditions): return is_fatal = any(