-
Notifications
You must be signed in to change notification settings - Fork 39
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
Enforce formatting #95
Conversation
self.build_account_map() | ||
|
||
self.initialized = True | ||
|
||
def build_account_map(self): | ||
# map transaction types to target posting accounts | ||
self.target_account_map = { | ||
"buymf": self.config['cash_account'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to have these be left untouched? It's much more readable the way it currently is IMHO. There are several of this type of block.
@@ -34,6 +34,4 @@ def get_balance_statement(self, file=None): | |||
|
|||
date = self.get_balance_assertion_date() | |||
if date: | |||
yield banking.Balance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these types of cases be excluded? Perhaps by increasing line width? IMHO, the formatted version is less readable here.
Hello there, thanks for the PR! I think this is in general a good idea, and in particular helpful to keep contributions from multiple users consistent. However, it does seem to reduce readability in a few cases. I quickly highlighted a couple patterns, there are probably a few others. If you're familiar with ruff and its options, it'd be great if you could help figure out those cases at least, and I'd be happy to take it in. Thanks again! |
I did a bit more digging and the option set is pretty limited. The ruff formatter pretty much matches black which intentionally gives you very few options to change so all code formatted with it should look the same. For specific cases this can be done: # fmt: off
code_here()
...
#fmt: on I would argue consistency across the board is better but let me know if you want formatting disabled on the sections you pointed out. |
Thanks for looking this up. You make a good point, and I agree overall. I still feel like f you're okay making the change to exclude those blocks alone, I'd be happy to take it in. Thank you! |
facce82
to
142c5f6
Compare
Made a few more changes:
|
Looks great, I appreciate the PR and the changes! This was long needed. Merged. Thank you! |
Adds a job to check formatting and formats all existing files with ruff.
Config options if you want anything changed from the defaults.