zyntrixio / kiroshi

Monitors the Monitoring
0 stars 0 forks source link

feat: split mastercard feed into two files #12

Closed backwardspy closed 1 year ago

backwardspy commented 1 year ago

this PR is a big one!

changed functionality

the mastercard SFTP process now creates two files; one for positive transactions and one for negative transactions. this is to allow harmonia to import them separately as different feed types, similar to how it already works for visa.

refactoring

i've enabled all ruff lints (except for a few conflicting rules) and refactored the project to keep ruff happy. this mainly consists of adding docstrings to everything, but in some places i've had to make other small tweaks such as adding explicit timeouts to requests.

for convenience, i've added a scripts/ dir containing two scripts; lint which runs ruff & black in check mode, and format which runs ruff & black in fix mode. both are intended for local use, though i have also changed the CI to invoke the lint script.

i have tried to keep all changes (other than the mastercard file splitting part) to the minimum necessary to make ruff happy. this means that some lints are being disabled with # noqa commands at the moment, as i didn't want to change any functionality to fix them. we can revisit these soon as additional approvements.

please let me know if you disagree with any of the changes, there may be alternative ways to fix the lints in some cases!