Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint #1379

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Pylint #1379

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion py/bitbox02/bitbox02/bitbox02/bitbox02.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from bitbox02.communication.generated import antiklepto_pb2 as antiklepto
import google.protobuf.empty_pb2

# pylint: disable=unused-import
# pylint: disable=unused-import,ungrouped-imports
# We export it in __init__.py
from bitbox02.communication.generated import system_pb2 as system
except ModuleNotFoundError:
Expand Down Expand Up @@ -116,6 +116,9 @@ class BTCInputType(TypedDict):

class BTCOutputInternal:
# TODO: Use NamedTuple, but not playing well with protobuf types.
"""
Internal transaction output (output belongs to BitBox).
"""

def __init__(
self,
Expand All @@ -135,6 +138,9 @@ def __init__(

class BTCOutputExternal:
# TODO: Use NamedTuple, but not playing well with protobuf types.
"""
External transaction output.
"""

def __init__(self, output_type: "btc.BTCOutputType.V", output_payload: bytes, value: int):
self.type = output_type
Expand Down Expand Up @@ -807,6 +813,8 @@ def eth_sign(
"""
transaction should be given as a full rlp encoded eth transaction.
"""
# pylint: disable=no-member

is_eip1559 = transaction.startswith(b"\x02")

def handle_antiklepto(request: eth.ETHRequest) -> bytes:
Expand Down
4 changes: 2 additions & 2 deletions py/send_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _setup_workflow(self) -> None:
else:
try:
entropy_size = int(entropy_size_inp)
except:
except ValueError:
eprint("Failed")
return

Expand Down Expand Up @@ -1529,7 +1529,7 @@ def _get_versions(self) -> None:

def _get_hardware(self) -> None:
secure_chip = self._device.hardware()["secure_chip_model"]
print(f"Hardware variant:")
print("Hardware variant:")
print(f"- Secure Chip: {secure_chip.value}")

def _erase(self) -> None:
Expand Down
22 changes: 11 additions & 11 deletions scripts/lint-python
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,26 @@ ${PYLINT} --persistent=no "${ARGS[@]}" || {
# 32 usage error
pylint_status=$?
exitcode=0
if (( ${pylint_status} \& 1 )); then
echo fatal messsage >&2
if (( ${pylint_status} & 1 )); then
echo fatal message >&2
exitcode=2
fi
if (( ${pylint_status} \& 2 )); then
echo error messsage >&2
if (( ${pylint_status} & 2 )); then
echo error message >&2
exitcode=2
fi
if (( ${pylint_status} \& 4 )); then
echo warning messsage >&2
if (( ${pylint_status} & 4 )); then
echo warning message >&2
exitcode=2
fi
if (( ${pylint_status} \& 8 )); then
echo refactor messsage >&2
if (( ${pylint_status} & 8 )); then
echo refactor message >&2
fi
if (( ${pylint_status} \& 16 )); then
echo convention messsage >&2
if (( ${pylint_status} & 16 )); then
echo convention message >&2
fi
# This should not happen!
if (( ${pylint_status} \& 32 )); then
if (( ${pylint_status} & 32 )); then
echo usage error >&2
exitcode=2
fi
Expand Down
Loading