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

Use ruff for our python lints #1378

Merged
merged 9 commits into from
Feb 22, 2023
Merged

Use ruff for our python lints #1378

merged 9 commits into from
Feb 22, 2023

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Feb 22, 2023

Ruff seems likely to be faster and more stable, though it did want to re-sort a lot of our imports.
These mostly seem to make sense, since from the perspective of examples, rerun is just another external dep and should be sorted as such.

$ time just py-lint
black --check --config rerun_py/pyproject.toml --diff examples rerun_py scripts
All done! ✨ 🍰 ✨
80 files would be left unchanged.
blackdoc --check examples rerun_py scripts
All done! ✨ 🍰 ✨
82 files would be left unchanged.
ruff check --config rerun_py/pyproject.toml  examples rerun_py scripts

real    0m0.384s
user    0m1.448s
sys     0m0.236s

And looks to run consistently in CI:
image

#1377

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I've added a line to CHANGELOG.md (if this is a big enough change to warrant it)

@jleibs jleibs marked this pull request as ready for review February 22, 2023 15:20
justfile Show resolved Hide resolved
@jleibs jleibs added the 🧑‍💻 dev experience developer experience (excluding CI) label Feb 22, 2023
justfile Show resolved Hide resolved
rerun_py/pyproject.toml Outdated Show resolved Hide resolved
rerun_py/pyproject.toml Outdated Show resolved Hide resolved
rerun_py/pyproject.toml Outdated Show resolved Hide resolved
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Let's delete .flake8 too

Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

so nice!

@@ -2,6 +2,7 @@
// See https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"charliermarsh.ruff", // Ruff for linting
Copy link
Member

Choose a reason for hiding this comment

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

niiiice

@jleibs jleibs merged commit e4af142 into main Feb 22, 2023
@jleibs jleibs deleted the jleibs/ruff_lints branch February 22, 2023 16:21
emilk pushed a commit that referenced this pull request Mar 2, 2023
* Switch linting to ruff

* Updates from ruff linter

* Format pyproject.toml

* Document the ruff configuration

* Remove .flake8

* Add recommendation for ruff extension and config to use our pyproject.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍💻 dev experience developer experience (excluding CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants