forked from platformio/platformio-core
Fix PyLint warnings
This commit is contained in:
@ -144,7 +144,7 @@ class AccountClient(HTTPClient): # pylint:disable=too-many-public-methods
|
||||
|
||||
def registration(
|
||||
self, username, email, password, firstname, lastname
|
||||
): # pylint:disable=too-many-arguments
|
||||
): # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
try:
|
||||
self.fetch_authentication_token()
|
||||
except: # pylint:disable=bare-except
|
||||
|
@ -61,7 +61,7 @@ def CleanProject(env, fullclean=False):
|
||||
print("Done cleaning")
|
||||
|
||||
|
||||
def AddTarget( # pylint: disable=too-many-arguments
|
||||
def AddTarget( # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
env,
|
||||
name,
|
||||
dependencies,
|
||||
|
@ -60,7 +60,7 @@ from platformio.project.helpers import find_project_dir_above, get_project_dir
|
||||
type=click.Choice(DefectItem.SEVERITY_LABELS.values()),
|
||||
)
|
||||
@click.option("--skip-packages", is_flag=True)
|
||||
def cli(
|
||||
def cli( # pylint: disable=too-many-positional-arguments
|
||||
environment,
|
||||
project_dir,
|
||||
project_conf,
|
||||
|
@ -29,7 +29,7 @@ class DefectItem:
|
||||
SEVERITY_LOW = 4
|
||||
SEVERITY_LABELS = {4: "low", 2: "medium", 1: "high"}
|
||||
|
||||
def __init__(
|
||||
def __init__( # pylint: disable=too-many-positional-arguments
|
||||
self,
|
||||
severity,
|
||||
category,
|
||||
|
@ -63,7 +63,7 @@ def validate_path(ctx, param, value): # pylint: disable=unused-argument
|
||||
@click.option("-e", "--environment", "environments", multiple=True)
|
||||
@click.option("-v", "--verbose", is_flag=True)
|
||||
@click.pass_context
|
||||
def cli( # pylint: disable=too-many-arguments, too-many-branches
|
||||
def cli( # pylint: disable=too-many-arguments,too-many-positional-arguments, too-many-branches
|
||||
ctx,
|
||||
src,
|
||||
lib,
|
||||
|
@ -152,7 +152,7 @@ def cli(ctx, **options):
|
||||
"-f", "--force", is_flag=True, help="Reinstall/redownload library if exists"
|
||||
)
|
||||
@click.pass_context
|
||||
def lib_install( # pylint: disable=too-many-arguments,unused-argument
|
||||
def lib_install( # pylint: disable=too-many-arguments,too-many-positional-arguments,unused-argument
|
||||
ctx, libraries, save, silent, interactive, force
|
||||
):
|
||||
click.secho(
|
||||
@ -210,7 +210,7 @@ def lib_uninstall(ctx, libraries, save, silent):
|
||||
@click.option("-s", "--silent", is_flag=True, help="Suppress progress reporting")
|
||||
@click.option("--json-output", is_flag=True)
|
||||
@click.pass_context
|
||||
def lib_update( # pylint: disable=too-many-arguments
|
||||
def lib_update( # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
ctx, libraries, only_check, dry_run, silent, json_output
|
||||
):
|
||||
only_check = dry_run or only_check
|
||||
|
@ -159,7 +159,7 @@ def platform_show(ctx, platform, json_output): # pylint: disable=too-many-branc
|
||||
help="Reinstall/redownload dev/platform and its packages if exist",
|
||||
)
|
||||
@click.pass_context
|
||||
def platform_install( # pylint: disable=too-many-arguments
|
||||
def platform_install( # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
ctx,
|
||||
platforms,
|
||||
with_package,
|
||||
@ -224,7 +224,7 @@ def platform_uninstall(ctx, platforms):
|
||||
@click.option("-s", "--silent", is_flag=True, help="Suppress progress reporting")
|
||||
@click.option("--json-output", is_flag=True)
|
||||
@click.pass_context
|
||||
def platform_update( # pylint: disable=too-many-locals, too-many-arguments
|
||||
def platform_update( # pylint: disable=too-many-locals,too-many-arguments,too-many-positional-arguments
|
||||
ctx, platforms, only_check, dry_run, silent, json_output, **_
|
||||
):
|
||||
only_check = dry_run or only_check
|
||||
|
@ -57,7 +57,7 @@ from platformio.project.options import ProjectOptions
|
||||
@click.option("--interface", type=click.Choice(["gdb"]))
|
||||
@click.argument("client_extra_args", nargs=-1, type=click.UNPROCESSED)
|
||||
@click.pass_context
|
||||
def cli(
|
||||
def cli( # pylint: disable=too-many-positional-arguments
|
||||
ctx,
|
||||
project_dir,
|
||||
project_conf,
|
||||
@ -111,7 +111,9 @@ def cli(
|
||||
return None
|
||||
|
||||
|
||||
def _configure(ctx, project_config, env_name, load_mode, verbose, client_extra_args):
|
||||
def _configure(
|
||||
ctx, project_config, env_name, load_mode, verbose, client_extra_args
|
||||
): # pylint: disable=too-many-positional-arguments
|
||||
platform = PlatformFactory.from_env(env_name, autoinstall=True)
|
||||
debug_config = DebugConfigFactory.new(
|
||||
platform,
|
||||
|
@ -76,7 +76,7 @@ def get_default_debug_env(config):
|
||||
|
||||
def predebug_project(
|
||||
ctx, project_dir, project_config, env_name, preload, verbose
|
||||
): # pylint: disable=too-many-arguments
|
||||
): # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
debug_testname = project_config.get("env:" + env_name, "debug_test")
|
||||
if debug_testname:
|
||||
test_names = list_test_names(project_config)
|
||||
|
@ -89,7 +89,7 @@ def is_serial_port_ready(port, timeout=1):
|
||||
|
||||
|
||||
class SerialPortFinder:
|
||||
def __init__( # pylint: disable=too-many-arguments
|
||||
def __init__( # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
self,
|
||||
board_config=None,
|
||||
upload_protocol=None,
|
||||
|
@ -82,7 +82,7 @@ def validate_datetime(ctx, param, value): # pylint: disable=unused-argument
|
||||
help="Do not show interactive prompt",
|
||||
hidden=True,
|
||||
)
|
||||
def package_publish_cmd( # pylint: disable=too-many-arguments, too-many-locals
|
||||
def package_publish_cmd( # pylint: disable=too-many-arguments,too-many-positional-arguments,too-many-locals
|
||||
package, owner, typex, released_at, private, notify, no_interactive, non_interactive
|
||||
):
|
||||
click.secho("Preparing a package...", fg="cyan")
|
||||
|
@ -38,7 +38,7 @@ class PlatformPackageManager(BasePackageManager): # pylint: disable=too-many-an
|
||||
def manifest_names(self):
|
||||
return PackageType.get_manifest_map()[PackageType.PLATFORM]
|
||||
|
||||
def install( # pylint: disable=arguments-differ,too-many-arguments
|
||||
def install( # pylint: disable=arguments-differ,too-many-arguments,too-many-positional-arguments
|
||||
self,
|
||||
spec,
|
||||
skip_dependencies=False,
|
||||
|
@ -196,7 +196,7 @@ class PackageOutdatedResult:
|
||||
|
||||
|
||||
class PackageSpec: # pylint: disable=too-many-instance-attributes
|
||||
def __init__( # pylint: disable=redefined-builtin,too-many-arguments
|
||||
def __init__( # pylint: disable=redefined-builtin,too-many-arguments,too-many-positional-arguments
|
||||
self, raw=None, owner=None, id=None, name=None, requirements=None, uri=None
|
||||
):
|
||||
self._requirements = None
|
||||
|
@ -44,7 +44,7 @@ class PlatformRunMixin:
|
||||
value = json.loads(value)
|
||||
return value
|
||||
|
||||
def run( # pylint: disable=too-many-arguments
|
||||
def run( # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
self, variables, targets, silent, verbose, jobs
|
||||
):
|
||||
assert isinstance(variables, dict)
|
||||
|
@ -68,7 +68,7 @@ def validate_boards(ctx, param, value): # pylint: disable=unused-argument
|
||||
@click.option("--no-install-dependencies", is_flag=True)
|
||||
@click.option("--env-prefix", default="")
|
||||
@click.option("-s", "--silent", is_flag=True)
|
||||
def project_init_cmd(
|
||||
def project_init_cmd( # pylint: disable=too-many-positional-arguments
|
||||
project_dir,
|
||||
boards,
|
||||
ide,
|
||||
|
@ -23,7 +23,7 @@ from platformio import fs
|
||||
from platformio.compat import IS_WINDOWS
|
||||
|
||||
|
||||
class ConfigOption: # pylint: disable=too-many-instance-attributes
|
||||
class ConfigOption: # pylint: disable=too-many-instance-attributes,too-many-positional-arguments
|
||||
def __init__(
|
||||
self,
|
||||
scope,
|
||||
|
@ -42,7 +42,7 @@ class RegistryClient(HTTPClient):
|
||||
pass
|
||||
return False
|
||||
|
||||
def publish_package( # pylint: disable=redefined-builtin
|
||||
def publish_package( # pylint: disable=redefined-builtin, too-many-positional-arguments
|
||||
self, owner, type, archive_path, released_at=None, private=False, notify=True
|
||||
):
|
||||
with open(archive_path, "rb") as fp:
|
||||
@ -64,7 +64,7 @@ class RegistryClient(HTTPClient):
|
||||
x_with_authorization=True,
|
||||
)
|
||||
|
||||
def unpublish_package( # pylint: disable=redefined-builtin
|
||||
def unpublish_package( # pylint: disable=redefined-builtin, too-many-positional-arguments
|
||||
self, owner, type, name, version=None, undo=False
|
||||
):
|
||||
path = "/v3/packages/%s/%s/%s" % (owner, type, name)
|
||||
@ -142,7 +142,9 @@ class RegistryClient(HTTPClient):
|
||||
x_with_authorization=self.allowed_private_packages(),
|
||||
)
|
||||
|
||||
def get_package(self, typex, owner, name, version=None, extra_path=None):
|
||||
def get_package(
|
||||
self, typex, owner, name, version=None, extra_path=None
|
||||
): # pylint: disable=too-many-positional-arguments
|
||||
try:
|
||||
return self.fetch_json_data(
|
||||
"get",
|
||||
|
@ -110,7 +110,7 @@ def remote_update(agents, only_check, dry_run):
|
||||
@click.option("-v", "--verbose", is_flag=True)
|
||||
@click.pass_obj
|
||||
@click.pass_context
|
||||
def remote_run(
|
||||
def remote_run( # pylint: disable=too-many-positional-arguments
|
||||
ctx,
|
||||
agents,
|
||||
environment,
|
||||
@ -198,7 +198,7 @@ def remote_run(
|
||||
@click.option("--verbose", "-v", is_flag=True)
|
||||
@click.pass_obj
|
||||
@click.pass_context
|
||||
def remote_test( # pylint: disable=redefined-builtin
|
||||
def remote_test( # pylint: disable=redefined-builtin,too-many-positional-arguments
|
||||
ctx,
|
||||
agents,
|
||||
environment,
|
||||
|
@ -239,7 +239,7 @@ class RunOrTestClient(AsyncClientBase):
|
||||
except (AttributeError, pb.DeadReferenceError):
|
||||
self.disconnect(exit_code=1)
|
||||
|
||||
def cb_psync_upload_chunk_result( # pylint: disable=too-many-arguments
|
||||
def cb_psync_upload_chunk_result( # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
self, result, agent_id, ac_id, dbindex, fileobj
|
||||
):
|
||||
result = PROJECT_SYNC_STAGE.lookupByValue(result)
|
||||
|
@ -30,7 +30,7 @@ class SSLContextFactory(ssl.ClientContextFactory):
|
||||
ctx.load_verify_locations(certifi.where())
|
||||
return ctx
|
||||
|
||||
def verifyHostname( # pylint: disable=unused-argument,too-many-arguments
|
||||
def verifyHostname( # pylint: disable=unused-argument,too-many-arguments,too-many-positional-arguments
|
||||
self, connection, x509, errno, depth, status
|
||||
):
|
||||
cn = x509.get_subject().commonName
|
||||
|
@ -76,7 +76,7 @@ except NotImplementedError:
|
||||
@click.option("-s", "--silent", is_flag=True)
|
||||
@click.option("-v", "--verbose", is_flag=True)
|
||||
@click.pass_context
|
||||
def cli(
|
||||
def cli( # pylint: disable=too-many-positional-arguments
|
||||
ctx,
|
||||
environment,
|
||||
target,
|
||||
@ -174,7 +174,7 @@ def cli(
|
||||
return True
|
||||
|
||||
|
||||
def process_env(
|
||||
def process_env( # pylint: disable=too-many-positional-arguments
|
||||
ctx,
|
||||
name,
|
||||
config,
|
||||
|
@ -22,7 +22,7 @@ from platformio.test.runners.base import CTX_META_TEST_RUNNING_NAME
|
||||
|
||||
|
||||
class EnvironmentProcessor:
|
||||
def __init__( # pylint: disable=too-many-arguments
|
||||
def __init__( # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
self,
|
||||
cmd_ctx,
|
||||
name,
|
||||
|
@ -90,7 +90,7 @@ from platformio.test.runners.factory import TestRunnerFactory
|
||||
help="Increase verbosity level, maximum is 3 levels (-vvv), see docs for details",
|
||||
)
|
||||
@click.pass_context
|
||||
def cli( # pylint: disable=too-many-arguments,too-many-locals,redefined-builtin
|
||||
def cli( # pylint: disable=too-many-arguments,too-many-positional-arguments,too-many-locals,redefined-builtin
|
||||
ctx,
|
||||
environment,
|
||||
ignore,
|
||||
|
@ -55,7 +55,7 @@ class TestCaseSource:
|
||||
|
||||
|
||||
class TestCase:
|
||||
def __init__( # pylint: disable=too-many-arguments
|
||||
def __init__( # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
self,
|
||||
name,
|
||||
status,
|
||||
|
@ -26,7 +26,7 @@ CTX_META_TEST_RUNNING_NAME = __name__ + ".test_running_name"
|
||||
|
||||
|
||||
class TestRunnerOptions: # pylint: disable=too-many-instance-attributes
|
||||
def __init__( # pylint: disable=too-many-arguments
|
||||
def __init__( # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
self,
|
||||
verbose=0,
|
||||
without_building=False,
|
||||
|
Reference in New Issue
Block a user