From 8660b46cdb209f4f63422bd9841bcc2a2799b342 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 12:37:51 +0000 Subject: [PATCH] style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf This commit fixes the style issues introduced in fd4163d according to the output from Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf. Details: None --- transaction_processing/transaction_routing.py | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/transaction_processing/transaction_routing.py b/transaction_processing/transaction_routing.py index e11ee5ea2..499748e38 100644 --- a/transaction_processing/transaction_routing.py +++ b/transaction_processing/transaction_routing.py @@ -1,18 +1,20 @@ class TransactionRouter: def __init__(self): self.routing_rules = { - 'domestic': { - 'regex': r'^\d{10}$', - 'message': 'Invalid account number format. Please enter a 10-digit account number.' + "domestic": { + "regex": r"^\d{10}$", + "message": "Invalid account number format. Please enter a 10-digit account number.", + }, + "international": { + "regex": r"^\d{12}$", + "message": "Invalid account number format. Please enter a 12-digit account number.", }, - 'international': { - 'regex': r'^\d{12}$', - 'message': 'Invalid account number format. Please enter a 12-digit account number.' - } } def route_transaction(self, transaction): for rule in self.routing_rules: - if re.match(self.routing_rules[rule]['regex'], transaction['account_number']): + if re.match( + self.routing_rules[rule]["regex"], transaction["account_number"] + ): return rule - raise ValueError('Invalid account number format.') + raise ValueError("Invalid account number format.")