Skip to content

Commit 5073313

Browse files
committed
PyLint fixes
1 parent 18b6aad commit 5073313

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

Diff for: .pylintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ disable=
88
invalid-name,
99
too-few-public-methods,
1010
consider-using-f-string,
11-
cyclic-import
11+
cyclic-import,
12+
use-dict-literal

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
lint:
2-
pylint --rcfile=./.pylintrc ./tests
32
pylint --rcfile=./.pylintrc ./platformio
3+
pylint --rcfile=./.pylintrc ./tests
44

55
isort:
66
isort ./platformio

Diff for: platformio/check/defect.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import click
1818

19+
from platformio.exception import PlatformioException
1920
from platformio.project.helpers import get_project_dir
2021

2122
# pylint: disable=too-many-instance-attributes, redefined-builtin
@@ -79,7 +80,7 @@ def severity_to_int(label):
7980
for key, value in DefectItem.SEVERITY_LABELS.items():
8081
if label == value:
8182
return key
82-
raise Exception("Unknown severity label -> %s" % label)
83+
raise PlatformioException("Unknown severity label -> %s" % label)
8384

8485
def as_dict(self):
8586
return {

Diff for: platformio/device/monitor/terminal.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,8 @@ def new_serial_instance(options): # pylint: disable=too-many-branches
144144
except KeyboardInterrupt as exc:
145145
click.echo("", err=True)
146146
raise UserSideException("User aborted and port is not given") from exc
147-
else:
148-
if not port:
149-
raise UserSideException("Port is not given")
147+
if not port:
148+
raise UserSideException("Port is not given")
150149
try:
151150
serial_instance = serial.serial_for_url(
152151
port,

Diff for: platformio/home/rpc/handlers/piocore.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from platformio import __main__, __version__, fs, proc
2626
from platformio.compat import get_locale_encoding, is_bytes
2727
from platformio.home import helpers
28+
from platformio.exception import PlatformioException
2829

2930

3031
class MultiThreadingStdStream:
@@ -132,7 +133,7 @@ def _process_result(result, to_json=False):
132133
err = err.decode(get_locale_encoding())
133134
text = ("%s\n\n%s" % (out, err)).strip()
134135
if code != 0:
135-
raise Exception(text)
136+
raise PlatformioException(text)
136137
if not to_json:
137138
return text
138139
try:

0 commit comments

Comments
 (0)