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 the isort-style import autofix via ruff #6020

Merged
merged 1 commit into from
Jan 3, 2023

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Jan 3, 2023

We were detecting it, but not acting on it.
With fix enabled, the fixable list constrains what it will attempt to autofix.

Before (example)

venv/bin/ruff .
polars/internals/expr/expr.py:1:1: I001 Import block is un-sorted or un-formatted

After

venv/bin/ruff .
Found 1 error(s) (1 fixed, 0 remaining).

@stinodego
Copy link
Member

Ruff is actually good at autofixing all kind of stuff. Enabling isort is a good start - we should probably look into what else it can autofix, without it being annoying.

@ritchie46 ritchie46 changed the title Enable the isort-style import autofix via ruff chore(python): Enable the isort-style import autofix via ruff Jan 3, 2023
@ritchie46 ritchie46 merged commit 53d2e4c into pola-rs:master Jan 3, 2023
@github-actions github-actions bot added chore Maintenance work that does not impact the user python Related to Python Polars labels Jan 3, 2023
@alexander-beedie
Copy link
Collaborator Author

Ruff is actually good at autofixing all kind of stuff. Enabling isort is a good start - we should probably look into what else it can autofix, without it being annoying.

Indeed! I figured we should start small and work our way up... :)

KivalM pushed a commit to rohit-ptl/polars that referenced this pull request Jan 4, 2023
@alexander-beedie alexander-beedie deleted the ruff-config branch January 5, 2023 19:39
zundertj pushed a commit to zundertj/polars that referenced this pull request Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance work that does not impact the user python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants