Skip to content

Commit 75629ff

Browse files
committed
chore: fix style complaints
1 parent 667e051 commit 75629ff

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

Makefile

+8-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ SETUP=$(PYTHON) setup.py
33

44
EXCLUDES=.vscode
55

6+
STYLE_TARGETS=src tests tools *.py
7+
68
all: build
79

810
build:
@@ -39,12 +41,13 @@ clean-test: ## remove test and coverage artifacts
3941
git-clean:
4042
git clean -dfx -e $(EXCLUDES)
4143

42-
style: style_check
43-
black .
44+
style:
45+
black $(STYLE_TARGETS)
46+
make style_check
4447

4548
style_check:
46-
black --check .
47-
flake8 src tests tools *.py
48-
mypy .
49+
black --check $(STYLE_TARGETS)
50+
flake8 $(STYLE_TARGETS)
51+
mypy $(STYLE_TARGETS)
4952

5053
.PHONY: all build install clean style style_check git-clean clean-build clean-pyc clean-test

setup.cfg

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ extend-ignore =
33
# E203: Whitespace before ':'
44
E203,
55
# E501: line too long
6-
E501
6+
E501,
7+
# I900: not listed as requirement
8+
I900,
79

810
[mypy]
911
warn_unreachable = True

setup.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python3
22
from pathlib import Path
3-
import os
43
from setuptools import setup
54

65
CWD = Path(__file__).resolve().parent
@@ -13,8 +12,10 @@
1312
author_email="[email protected]",
1413
description="Implementation of Bitcoin BIP-0039",
1514
long_description="\n".join(
16-
(CWD / "README.rst").read_text(),
17-
(CWD / "CHANGELOG.rst").read_text(),
15+
(
16+
(CWD / "README.rst").read_text(),
17+
(CWD / "CHANGELOG.rst").read_text(),
18+
)
1819
),
1920
url="https://github.com/trezor/python-mnemonic",
2021
packages=["mnemonic"],

src/mnemonic/mnemonic.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ def to_mnemonic(self, data: bytes) -> str:
189189
for i in range(len(b) // 11):
190190
idx = int(b[i * 11 : (i + 1) * 11], 2)
191191
result.append(self.wordlist[idx])
192-
if (
193-
self.language == "japanese"
194-
): # Japanese must be joined by ideographic space.
192+
if self.language == "japanese": # Japanese must be joined by ideographic space.
195193
result_phrase = u"\u3000".join(result)
196194
else:
197195
result_phrase = " ".join(result)

tests/test_mnemonic.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from mnemonic import Mnemonic
3030

3131

32-
3332
class MnemonicTest(unittest.TestCase):
3433
def _check_list(self, language: str, vectors: List[str]) -> None:
3534
mnemo = Mnemonic(language)

0 commit comments

Comments
 (0)