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 flake8 and isort with ruff #394

Merged
merged 1 commit into from
Apr 26, 2023
Merged

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Apr 26, 2023

Ruff supports over 500 lint rules and can be used to replace Flake8 (plus dozens of plugins), isort, pydocstyle, yesqa, eradicate, pyupgrade, and autoflake, all while executing (in Rust) tens or hundreds of times faster than any individual tool.

The ruff Action uses minimal steps to run in ~5 seconds, rapidly providing intuitive GitHub Annotations to contributors.

image

Running the complete test matrix on GitHub Actions takes a lot of time and CPU. Given that the ruff linting job is so fast (~5 seconds) let's ensure that linting passes before the complete test matrix is run. This will cost a few seconds on each run but could save a lot of time and contention for PRs that should be cleaned up before they are fully tested.

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds
image

@cclauss cclauss requested a review from acdha April 26, 2023 09:32
@cclauss cclauss added the tests label Apr 26, 2023
acdha
acdha previously approved these changes Apr 26, 2023
@acdha
Copy link
Collaborator

acdha commented Apr 26, 2023

Looks like we need codespell to ignore the .git directory

@acdha
Copy link
Collaborator

acdha commented Apr 26, 2023

Thanks for doing this! I think we get the last couple spellcheck items in & then do a second PR where we enable the pyupgrade fixes and remove the remaining Python 2 compatibility code.

@acdha acdha enabled auto-merge (squash) April 26, 2023 13:28
@cclauss cclauss requested a review from acdha April 26, 2023 14:37
@acdha acdha merged commit 1edd85b into django-haystack:master Apr 26, 2023
@cclauss cclauss deleted the ruff branch April 26, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants