Skip to content
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

Merged
merged 10 commits into from
Jun 11, 2024
Merged

Chores/CS and linter fixes backend #457

merged 10 commits into from
Jun 11, 2024

Conversation

devmount
Copy link
Collaborator

@devmount devmount commented Jun 6, 2024

Description of the Change

This applies black and ruff 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.toml

Benefits

Consistent code base

Applicable Issues

None

@devmount devmount requested a review from MelissaAutumn June 6, 2024 09:07
@devmount devmount self-assigned this Jun 6, 2024
backend/pyproject.toml Outdated Show resolved Hide resolved
@devmount devmount changed the title Chores/CS and linter fixes Chores/CS and linter fixes backend Jun 6, 2024
@MelissaAutumn
Copy link
Member

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.

@devmount
Copy link
Collaborator Author

devmount commented Jun 7, 2024

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!

@devmount
Copy link
Collaborator Author

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'"

@MelissaAutumn
Copy link
Member

MelissaAutumn commented Jun 10, 2024

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 🤔

@devmount
Copy link
Collaborator Author

I actually tried that too without success, but I can add it to the pyproject.toml nevertheless

@devmount
Copy link
Collaborator Author

Ok, I now added the inline quotes rule as well.

@MelissaAutumn
Copy link
Member

Thanks!

subscriber and subscriber.minimum_valid_iat_time and subscriber.minimum_valid_iat_time.timestamp() > int(iat)
]):
if any(
[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems excessive.

Copy link
Collaborator Author

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,
}
)
Copy link
Member

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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems excessive

@devmount devmount merged commit a6b5ae3 into main Jun 11, 2024
4 checks passed
@devmount devmount deleted the chores/cs-fixes branch June 11, 2024 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants