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

fix: Lint Python code with ruff #3799

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jun 26, 2024

What type of PR is this?

(REQUIRED)

  • cleanup

What this PR does / why we need it:

(REQUIRED)

Lint Python code with ruff to make it faster, easier to understand, and less error-prone.

Which issue(s) this PR fixes:

(REQUIRED)

Special notes for your reviewer:

(fill-in or delete this section)

Testing

(fill-in or delete this section)

% ruff check

@cclauss cclauss force-pushed the ruff branch 2 times, most recently from 0d9864a to 97ceb13 Compare June 26, 2024 16:00
@cclauss cclauss changed the title fix: pre-commit autoupdate and lint Python code with ruff fix: Lint Python code with ruff Jun 26, 2024
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the stale label Aug 11, 2024
@cclauss
Copy link
Contributor Author

cclauss commented Aug 11, 2024

Rebased to fix git conflicts.

@PatrickDeTomasi
Copy link

I'm a professional that uses Ruff in the workplace, I HIGHLY recommend implementing this, it has significantly improved my own quality and speed

@github-actions github-actions bot removed the stale label Aug 12, 2024
@michael-genson
Copy link
Collaborator

I'm not sure this PR is necessary; we already do this for every pull request:

https://github.com/mealie-recipes/mealie/blob/mealie-next/Taskfile.yml#L106-L114

The difference between this PR and the existing workflow is that the existing workflow only looks at changes, whereas this PR blanket applies rules to the entire codebase, which makes some unnecessary changes.

Can you go into more detail what issue this PR is trying to address?

@cclauss
Copy link
Contributor Author

cclauss commented Aug 12, 2024

Given that ruff is superfast (1/3 second for the CPython codebase), why limit its visibility? 40 files are not yet ruff compliant which seems a shame. This PR is attempting to get all files to be ruff-compliant and ensure they stay that way even when ruff rules are upgraded.

@michael-genson michael-genson enabled auto-merge (squash) August 12, 2024 15:02
Copy link
Collaborator

@michael-genson michael-genson left a comment

Choose a reason for hiding this comment

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

Fair enough. This might cause some merge conflicts with #3970 but that's fine

@michael-genson michael-genson merged commit 432914e into mealie-recipes:mealie-next Aug 12, 2024
11 checks passed
@cclauss cclauss deleted the ruff branch August 12, 2024 15:12
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