Fix flake8 warnings

This commit is contained in:
Luís Murta 2023-04-13 18:38:07 +01:00
parent d7bdafa62a
commit 26cf921a6f
Signed by: satprog
GPG Key ID: 169EF1BBD7049F94
5 changed files with 13 additions and 6 deletions

3
.flake8 Normal file
View File

@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203

View File

@ -65,7 +65,8 @@ class Interactive:
continue continue
if other.startswith("note:"): if other.startswith("note:"):
# TODO adding notes to a splitted transaction won't allow categorization # TODO adding notes to a splitted transaction won't allow
# categorization
next.note = Note(other[len("note:") :].strip()) next.note = Note(other[len("note:") :].strip())
else: else:
ct = other.split(":") ct = other.split(":")

View File

@ -54,7 +54,6 @@ groups = {
def categorize_data(db: DatabaseClient): def categorize_data(db: DatabaseClient):
# 1st) Classifying null transactions, i.e. transfers between banks. # 1st) Classifying null transactions, i.e. transfers between banks.
# Will not overwrite previous categories # Will not overwrite previous categories
nulls(db) nulls(db)
@ -77,7 +76,8 @@ def categorize_data(db: DatabaseClient):
# 4th) Manually update categories from the uncategorized transactions # 4th) Manually update categories from the uncategorized transactions
if transactions := db.get_uncategorized_transactions(): if transactions := db.get_uncategorized_transactions():
print( print(
f"Still {len(transactions)} uncategorized transactions left. Type quit/exit to exit the program." f"Still {len(transactions)} uncategorized transactions left. Type quit/exit"
"to exit the program."
) )
for transaction in transactions: for transaction in transactions:
while True: while True:
@ -88,7 +88,8 @@ def categorize_data(db: DatabaseClient):
break break
if category not in categories: if category not in categories:
print( print(
f"Category {category} doesn't exist. Please use one of {categories.keys()}" f"Category {category} doesn't exist. Please use one of"
f"{categories.keys()}"
) )
else: else:
transaction.category = category transaction.category = category

View File

@ -270,7 +270,8 @@ class Manager:
row["date"], row["description"], row["amount"] row["date"], row["description"], row["amount"]
) )
# TODO case "split" how to match to original transaction?? also save ids? # TODO case "split" how to match to original transaction?? also
# save ids?
case _: case _:
continue continue

View File

@ -141,7 +141,8 @@ ORDER BY date ASC
""" """
ADD_BANK = """ ADD_BANK = """
INSERT INTO banks (name, bic, nordigen_id, nordigen_name, requisition_id, invert) values (?,?,?,?,?,?) INSERT INTO banks (name, bic, nordigen_id, nordigen_name, requisition_id, invert)
values (?,?,?,?,?,?)
""" """
DELETE_BANK = """ DELETE_BANK = """