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