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

chore(clients): use the ruff python formatter #3204

Merged
merged 6 commits into from
Jun 19, 2024
Merged

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Jun 18, 2024

🧭 What and Why

The ruff formatter is blazingly fast and reduces the number of deps for python.

@millotp millotp self-assigned this Jun 18, 2024
@millotp millotp requested a review from a team as a code owner June 18, 2024 12:11
@millotp millotp requested review from damcou and shortcuts June 18, 2024 12:11
@algolia-bot
Copy link
Collaborator

algolia-bot commented Jun 18, 2024

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

Copy link

github-actions bot commented Jun 18, 2024

@github-actions github-actions bot temporarily deployed to pull request June 18, 2024 13:37 Inactive
@github-actions github-actions bot temporarily deployed to pull request June 18, 2024 14:05 Inactive
@github-actions github-actions bot temporarily deployed to pull request June 18, 2024 15:14 Inactive
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

Can we keep the previous ternary syntax? It was more readable

Other than that, looks really great!

@millotp
Copy link
Collaborator Author

millotp commented Jun 18, 2024

Can we keep the previous ternary syntax? It was more readable

I tried too but it's not supported yet, there is a feature request astral-sh/ruff#9722

@millotp
Copy link
Collaborator Author

millotp commented Jun 18, 2024

wdyt about the and syntax ? I could replace:

Outliers.from_dict(obj.get("outliers")) if obj.get("outliers") is not None else None     

with

obj.get("outliers") and Outliers.from_dict(obj.get("outliers"))   

@shortcuts
Copy link
Member

shortcuts commented Jun 18, 2024

wdyt about the and syntax ? I could replace:

Outliers.from_dict(obj.get("outliers")) if obj.get("outliers") is not None else None     

with

obj.get("outliers") and Outliers.from_dict(obj.get("outliers"))   

explicit* None seems better though :/ I guess we can wait for them to support it

Have you tried adding parentheses around the ternaries in the template, just to see if it's correctly indented?

@millotp
Copy link
Collaborator Author

millotp commented Jun 19, 2024

Have you tried adding parentheses around the ternaries in the template, just to see if it's correctly indented?

Indeed that works perfectly !

@millotp millotp requested a review from shortcuts June 19, 2024 07:39
@github-actions github-actions bot temporarily deployed to pull request June 19, 2024 07:40 Inactive
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

Niceee

@millotp millotp merged commit 36aabab into main Jun 19, 2024
21 checks passed
@millotp millotp deleted the chore/python-ruff branch June 19, 2024 07:49
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.

3 participants