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

chore: move to Ruff #2153

Merged
merged 5 commits into from
Jan 30, 2023
Merged

chore: move to Ruff #2153

merged 5 commits into from
Jan 30, 2023

Conversation

henryiii
Copy link
Member

@henryiii henryiii commented Jan 21, 2023

For me, this reduces the time spent in pre-commit from about 12 seconds to 6.6 seconds. Ruff takes <1 second to process the entire codebase, and can do the work of several tools. I think "check YAML" is now the slowest check. :)

It has several checks that look very useful, and autofix is amazing, but this is a very minimal conversion to start with.

This should also stop the failures caused by plugins updating, since everything is one versioned binary.

"docs-*",
"src/awkward/_typeparser/generated_parser.py",
]
ignore = ["E501", "C408", "E713", "E714", "UP030"]
Copy link
Member Author

Choose a reason for hiding this comment

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

Several of these eventually should be not skipped.

@codecov
Copy link

codecov bot commented Jan 21, 2023

Codecov Report

Merging #2153 (67d5b45) into main (da5cab0) will not change coverage.
The diff coverage is 69.23%.

❗ Current head 67d5b45 differs from pull request most recent head 20c5706. Consider uploading reports for the commit 20c5706 to get more accurate results

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/_errors.py 79.47% <0.00%> (ø)
src/awkward/_kernels.py 69.30% <0.00%> (ø)
src/awkward/operations/ak_to_parquet.py 52.04% <0.00%> (ø)
src/awkward/_util.py 76.79% <66.66%> (ø)
src/awkward/_nplikes/__init__.py 84.00% <100.00%> (ø)
src/awkward/_nplikes/array_module.py 92.00% <100.00%> (ø)
src/awkward/contents/content.py 73.13% <100.00%> (ø)
src/awkward/jax.py 84.74% <100.00%> (ø)
src/awkward/operations/ak_cartesian.py 90.62% <100.00%> (ø)
src/awkward/operations/ak_to_numpy.py 100.00% <100.00%> (ø)

@henryiii henryiii temporarily deployed to docs-preview January 21, 2023 19:34 — with GitHub Actions Inactive
@agoose77
Copy link
Collaborator

@jpivarski I'm happy with this, merge if you are too :)

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

I just tried it out, both with pre-commit and directly. The direct invocation found a not-real issue (UP003) because it doesn't know about some_llvmite_type in expressions like some_llvmlite_type.type(0); it's thinking we're doing the free function type(0), which for a constant like 0, would be just int.

I added noqa in case someone else runs into this.

Okay, I guess I should report this to the ruff developers. Nope! It's already done: astral-sh/ruff#1958

There's a commit test that will remove the noqa when it's no longer needed. I'm going to remove the text of the comment other than the bare noqa so that it will be removed cleanly. (noqa removal tries to preserve the rest of the commit message, which will become nonsensical when the noqa is gone...)

@jpivarski jpivarski enabled auto-merge (squash) January 30, 2023 16:25
@jpivarski jpivarski temporarily deployed to docs-preview January 30, 2023 16:31 — with GitHub Actions Inactive
@jpivarski jpivarski merged commit a420bc2 into main Jan 30, 2023
@jpivarski jpivarski deleted the henryiii/chore/ruff branch January 30, 2023 16:43
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