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

Replace Pyupgrade with Ruff rule #3795

Merged
merged 6 commits into from
Jun 5, 2024

Conversation

JasonGrace2282
Copy link
Member

This PR replaces the pre-commit hook pyupgrade with the respective rules in the ruff linter.

@JasonGrace2282 JasonGrace2282 requested a review from Viicos June 4, 2024 03:55
@JasonGrace2282 JasonGrace2282 marked this pull request as draft June 4, 2024 04:56
@JasonGrace2282 JasonGrace2282 marked this pull request as ready for review June 4, 2024 11:39
@@ -182,7 +182,7 @@ def get_custom_labels(
tex_labels = [
Integer(
self.base,
unit="^{%s}" % (f"{self.inverse_function(i):.{unit_decimal_places}f}"),
unit="^{%s}" % (f"{self.inverse_function(i):.{unit_decimal_places}f}"), # noqa: UP031
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
unit="^{%s}" % (f"{self.inverse_function(i):.{unit_decimal_places}f}"), # noqa: UP031
unit="^{:.{prec}f}".format(self.inverse_function(i), prec=unit_decimal_places)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is kind of hard to understand, and also causes the tests to fail.

Copy link
Member

Choose a reason for hiding this comment

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

I would say the original version is even more confusing. It was probably failing because of the missing f" prefix

manim/mobject/text/tex_mobject.py Show resolved Hide resolved
@JasonGrace2282 JasonGrace2282 merged commit e74f37e into ManimCommunity:main Jun 5, 2024
18 checks passed
@JasonGrace2282 JasonGrace2282 deleted the ruff-pyupgrade branch June 5, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants