-
Notifications
You must be signed in to change notification settings - Fork 9
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
Chores/CS and linter fixes backend #457
Conversation
Thanks for the config fixes! Seems like we might not need black anymore since ruff's formatter sells itself as a drop-in replacement. We should switch the quote style back to single quotes and try and fix the excessive param exploding when it comes to functions that contain a dictionary or list as its sole argument. |
I removed black and added a ruff rule to use single quotes (but somehow the single quotes don't get applied on fix 🤔 I'll investigate). Do you know which rule to add to fix the function parameters? Thanks! |
Ok for some reason the quotes config in pyproject.toml wasn't taken into account, so I manually ran this now: ruff format backend --config "format.quote-style = 'single'" |
I actually ran into this issue on a side project over the weekend, it's actually https://docs.astral.sh/ruff/settings/#lint_flake8-quotes_inline-quotes 🤔 |
I actually tried that too without success, but I can add it to the pyproject.toml nevertheless |
Ok, I now added the inline quotes rule as well. |
Thanks! |
subscriber and subscriber.minimum_valid_iat_time and subscriber.minimum_valid_iat_time.timestamp() > int(iat) | ||
]): | ||
if any( | ||
[ |
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.
This seems excessive.
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.
I agree, but I couldn't find a rule for that...
{ | ||
"id": user.id, | ||
} | ||
) |
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.
This seems excessive.
'deny_url': self.denyUrl, | ||
}) | ||
return l10n( | ||
"confirm-mail-plain", |
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.
This seems excessive
Description of the Change
This applies
black
andruff
on our current backend. Seems like we didn't do that for quite some time 😅 Let me know, if you want to change any rules here, afaik we're just applying default rules and a few in pyproject.tomlBenefits
Consistent code base
Applicable Issues
None