Skip to content

Add linting back to CI - Ruff #4270

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

KaiqueDultra
Copy link

Overview: What does this pull request change?

Add Ruff Linting back to CI (related to the issue #3622)

In detail:

  • Add the lint-ruff.yml workflow to run on each push and pull requests to the branch main.
  • Add some ignores inside the pyproject.toml like: PLR2004 to ignore some specifics errors related to literal values like numbers and strings used directly inside the code. PLR0913 to ignore too many arguments from the functions. (If need to include more ignores, please let me know).
  • Apply some auto-fixes related to ruff check .

Motivation and Explanation: Why and how do your changes improve the library?

With the return of linting now with ruff (instead of pylint) in CI, we will have more coverage of errors related to the manim source code, thus making it possible to maintain when necessary. Ruff offers significantly faster linting performance, broader rule support, and a cleaner configuration experience via pyproject.toml. This change improves both developer efficiency and maintainability of the codebase. Therefore, adding linting with ruff back to CI can contribute to the robustness of the library.

Links to added or changed documentation pages

There are no changes yet to documentation pages (if needed, please let me know).

Further Information and Comments

Not counting the auto-fixes already changed by ruff, 86 more errors were found:

Found 86 errors. No fixes available (5 hidden fixes can be enabled with the --unsafe-fixes option).

From my perspective these errors do not seriously affect the code yet, but it is worth investigating these small errors further in the future. I will check better these small errors and if I open an issue, I´ll let you know.

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

@JasonGrace2282
Copy link
Member

Hey, thanks for the interest in our linting setup! We currently already use ruff for linting in CI through pre-commit and pre-commit CI.
Perhaps your time would be better invested in choosing a new rule to add (we have a list in #3622) and making the necessary fixes?

@KaiqueDultra
Copy link
Author

Hello @JasonGrace2282!

Thank you for your feedback about this pull request. Sure, I will choose a new rule from the list in #3622 and implement it!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

2 participants