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(python): Enable additional ruff lint rule sets #18721

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Sep 12, 2024

Was adding a lot of additional linting at work, and saw some value in enabling a few additional ruff rule sets here too.

Additional rule sets

"ANN",  # flake8-annotations
"ICN",  # flake8-import-conventions
"INT",  # flake8-gettext
"PERF", # perflint
"PYI",  # flake8-pyi
  • Various minor nitpicks/consistency (eg: we sometimes did and sometimes didn't annotate the return from __init__ methods with -> None, and now we do so consistently everywhere), and so on. Nothing that looks especially controversial ;)

  • Some decent catches too, such as properly typing the return from context manager __enter__ with -> Self, and a few unnecessary list/dict comprehensions were spotted and suggested for optimisation.

Also

  • Minor version bump for ruff (from "0.6.3" to "0.6.4").

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Sep 12, 2024
@alexander-beedie alexander-beedie changed the title feat(python): Enable additional ruff lint rule sets (ANN, PERF, and PYI) chore(python): Enable additional ruff lint rule sets (ANN, PERF, and PYI) Sep 12, 2024
@github-actions github-actions bot added the internal An internal refactor or improvement label Sep 12, 2024
@alexander-beedie alexander-beedie changed the title chore(python): Enable additional ruff lint rule sets (ANN, PERF, and PYI) chore(python): Enable additional ruff lint rule sets Sep 12, 2024
@alexander-beedie alexander-beedie force-pushed the additional-lint branch 3 times, most recently from 5e6c582 to dd94f6a Compare September 12, 2024 13:44
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 94.82759% with 3 lines in your changes missing coverage. Please review.

Project coverage is 79.88%. Comparing base (0e5e554) to head (616a9c2).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
py-polars/polars/dataframe/frame.py 80.00% 1 Missing ⚠️
py-polars/polars/io/delta.py 0.00% 1 Missing ⚠️
py-polars/polars/lazyframe/frame.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18721      +/-   ##
==========================================
- Coverage   79.90%   79.88%   -0.02%     
==========================================
  Files        1513     1513              
  Lines      203465   203467       +2     
  Branches     2892     2892              
==========================================
- Hits       162579   162547      -32     
- Misses      40338    40372      +34     
  Partials      548      548              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit 7232554 into pola-rs:main Sep 13, 2024
17 checks passed
@alexander-beedie alexander-beedie deleted the additional-lint branch September 13, 2024 12:33
nameexhaustion pushed a commit to nameexhaustion/polars that referenced this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature internal An internal refactor or improvement python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants