mirror of
https://github.com/platformio/platformio-core.git
synced 2025-06-25 01:21:53 +02:00
PyLint fixes
This commit is contained in:
@ -8,4 +8,5 @@ disable=
|
|||||||
invalid-name,
|
invalid-name,
|
||||||
too-few-public-methods,
|
too-few-public-methods,
|
||||||
consider-using-f-string,
|
consider-using-f-string,
|
||||||
cyclic-import
|
cyclic-import,
|
||||||
|
use-dict-literal
|
||||||
|
2
Makefile
2
Makefile
@ -1,6 +1,6 @@
|
|||||||
lint:
|
lint:
|
||||||
pylint --rcfile=./.pylintrc ./tests
|
|
||||||
pylint --rcfile=./.pylintrc ./platformio
|
pylint --rcfile=./.pylintrc ./platformio
|
||||||
|
pylint --rcfile=./.pylintrc ./tests
|
||||||
|
|
||||||
isort:
|
isort:
|
||||||
isort ./platformio
|
isort ./platformio
|
||||||
|
@ -16,6 +16,7 @@ import os
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
|
from platformio.exception import PlatformioException
|
||||||
from platformio.project.helpers import get_project_dir
|
from platformio.project.helpers import get_project_dir
|
||||||
|
|
||||||
# pylint: disable=too-many-instance-attributes, redefined-builtin
|
# pylint: disable=too-many-instance-attributes, redefined-builtin
|
||||||
@ -79,7 +80,7 @@ class DefectItem:
|
|||||||
for key, value in DefectItem.SEVERITY_LABELS.items():
|
for key, value in DefectItem.SEVERITY_LABELS.items():
|
||||||
if label == value:
|
if label == value:
|
||||||
return key
|
return key
|
||||||
raise Exception("Unknown severity label -> %s" % label)
|
raise PlatformioException("Unknown severity label -> %s" % label)
|
||||||
|
|
||||||
def as_dict(self):
|
def as_dict(self):
|
||||||
return {
|
return {
|
||||||
|
@ -144,9 +144,8 @@ def new_serial_instance(options): # pylint: disable=too-many-branches
|
|||||||
except KeyboardInterrupt as exc:
|
except KeyboardInterrupt as exc:
|
||||||
click.echo("", err=True)
|
click.echo("", err=True)
|
||||||
raise UserSideException("User aborted and port is not given") from exc
|
raise UserSideException("User aborted and port is not given") from exc
|
||||||
else:
|
if not port:
|
||||||
if not port:
|
raise UserSideException("Port is not given")
|
||||||
raise UserSideException("Port is not given")
|
|
||||||
try:
|
try:
|
||||||
serial_instance = serial.serial_for_url(
|
serial_instance = serial.serial_for_url(
|
||||||
port,
|
port,
|
||||||
|
@ -25,6 +25,7 @@ from starlette.concurrency import run_in_threadpool
|
|||||||
from platformio import __main__, __version__, fs, proc
|
from platformio import __main__, __version__, fs, proc
|
||||||
from platformio.compat import get_locale_encoding, is_bytes
|
from platformio.compat import get_locale_encoding, is_bytes
|
||||||
from platformio.home import helpers
|
from platformio.home import helpers
|
||||||
|
from platformio.exception import PlatformioException
|
||||||
|
|
||||||
|
|
||||||
class MultiThreadingStdStream:
|
class MultiThreadingStdStream:
|
||||||
@ -132,7 +133,7 @@ class PIOCoreRPC:
|
|||||||
err = err.decode(get_locale_encoding())
|
err = err.decode(get_locale_encoding())
|
||||||
text = ("%s\n\n%s" % (out, err)).strip()
|
text = ("%s\n\n%s" % (out, err)).strip()
|
||||||
if code != 0:
|
if code != 0:
|
||||||
raise Exception(text)
|
raise PlatformioException(text)
|
||||||
if not to_json:
|
if not to_json:
|
||||||
return text
|
return text
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user