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+isort with ruff #3231

Merged
merged 2 commits into from
Jun 23, 2023
Merged

Replace flake8+isort with ruff #3231

merged 2 commits into from
Jun 23, 2023

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented Jun 21, 2023

Addresses #3230

This PR replaces Pyro's use of flake8 and isort with ruff, speeding up this phase of linting by about 200x.

Before this PR

$ time (flake8 ; isort --check .)
... 14.07s user 0.27s system 99% cpu 14.402 total

After this PR

$ time ruff check .
...  0.09s user 0.04s system 182% cpu 0.073 total

I've enabled only the most basic of ruff checks: E, F, and I.

Copy link
Collaborator

@martinjankowiak martinjankowiak left a comment

Choose a reason for hiding this comment

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

lgtm. will merge if there are no objections...

@fritzo
Copy link
Member Author

fritzo commented Jun 22, 2023

@fehiepsi you might consider using ruff for numpyro also. ruff has many checks beyond flake8+isort, and it is easy to incrementally opt-in to those checks.

@martinjankowiak martinjankowiak merged commit ea44053 into dev Jun 23, 2023
9 checks passed
@martinjankowiak martinjankowiak deleted the ruff branch June 23, 2023 18:00
@fehiepsi
Copy link
Member

thanks @fritzo. I'll take a look.

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

Successfully merging this pull request may close these issues.

None yet

3 participants