From 0d023777afa56fa2a592f59dd040e5a1f2bfc72d Mon Sep 17 00:00:00 2001 From: Avram Lubkin Date: Tue, 25 Oct 2022 13:48:29 -0400 Subject: [PATCH] Linting Fixes --- lisa/sut_orchestrator/libvirt/platform.py | 2 +- lisa/util/shell.py | 10 ++++++++-- typings/assertpy/base.pyi | 1 - typings/pluggy/__init__.pyi | 9 ++++----- typings/pluggy/manager.pyi | 7 +++---- typings/semver/__init__.pyi | 3 ++- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/lisa/sut_orchestrator/libvirt/platform.py b/lisa/sut_orchestrator/libvirt/platform.py index abddbb704..69503f1da 100644 --- a/lisa/sut_orchestrator/libvirt/platform.py +++ b/lisa/sut_orchestrator/libvirt/platform.py @@ -17,7 +17,7 @@ from threading import Lock, Timer from typing import Any, Dict, List, Optional, Tuple, Type, cast import libvirt # type: ignore -import pycdlib +import pycdlib # type: ignore import yaml from lisa import schema, search_space diff --git a/lisa/util/shell.py b/lisa/util/shell.py index 7744ac6ed..4e14fdcd6 100644 --- a/lisa/util/shell.py +++ b/lisa/util/shell.py @@ -379,7 +379,10 @@ class SshShell(InitializableMixin): self.spawn(command=["rm", path_str]) def chmod(self, path: PurePath, mode: int) -> None: - """Change the file mode bits of each given file according to mode (Posix targets only) + """ + Change the file mode bits of each given file according to mode + (Posix targets only) + Inputs: path: target path. (Absolute. Use a PurePosixPath, if the target node is a Posix one, because LISA @@ -693,7 +696,10 @@ class LocalShell(InitializableMixin): path.unlink() def chmod(self, path: PurePath, mode: int) -> None: - """Change the file mode bits of each given file according to mode (Posix targets only) + """ + Change the file mode bits of each given file according to mode + (Posix targets only) + Inputs: path: target path. (Absolute) mode: numerical chmod mode entry diff --git a/typings/assertpy/base.pyi b/typings/assertpy/base.pyi index ed772a1c4..cc28e5ea6 100644 --- a/typings/assertpy/base.pyi +++ b/typings/assertpy/base.pyi @@ -2,7 +2,6 @@ from typing import Any from .assertpy import AssertionBuilder - class BaseMixin: description: Any = ... def described_as(self, description: Any) -> AssertionBuilder: ... diff --git a/typings/pluggy/__init__.pyi b/typings/pluggy/__init__.pyi index 029263671..8c0b1c524 100644 --- a/typings/pluggy/__init__.pyi +++ b/typings/pluggy/__init__.pyi @@ -1,7 +1,6 @@ -from .hooks import HookimplMarker as HookimplMarker, HookspecMarker as HookspecMarker -from .manager import ( - PluginManager as PluginManager, - PluginValidationError as PluginValidationError, -) +from .hooks import HookimplMarker as HookimplMarker +from .hooks import HookspecMarker as HookspecMarker +from .manager import PluginManager as PluginManager +from .manager import PluginValidationError as PluginValidationError class HookCallError(Exception): ... diff --git a/typings/pluggy/manager.pyi b/typings/pluggy/manager.pyi index 1cc7abe70..59872f44b 100644 --- a/typings/pluggy/manager.pyi +++ b/typings/pluggy/manager.pyi @@ -1,9 +1,8 @@ -from .hooks import ( - HookImpl as HookImpl, - normalize_hookimpl_opts as normalize_hookimpl_opts, -) from typing import Any, Optional +from .hooks import HookImpl as HookImpl +from .hooks import normalize_hookimpl_opts as normalize_hookimpl_opts + class PluginValidationError(Exception): plugin: Any = ... def __init__(self, plugin: Any, message: Any) -> None: ... diff --git a/typings/semver/__init__.pyi b/typings/semver/__init__.pyi index 341c2cfd2..1bb86bf2f 100644 --- a/typings/semver/__init__.pyi +++ b/typings/semver/__init__.pyi @@ -2,8 +2,9 @@ This type stub file was generated by pyright. """ -import argparse from __future__ import print_function + +import argparse from typing import ( Any, Dict,