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: enable ruff's isort equivalent #28267

Merged
merged 1 commit into from
May 1, 2024
Merged

chore: enable ruff's isort equivalent #28267

merged 1 commit into from
May 1, 2024

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Apr 29, 2024

SUMMARY

Recently when I set up ruff (new linter/formatter that replaces black, isort, pyupgrade, ...) I didn't check that isort rules were enabled properly, this PR:

  • enables the isort-like features
  • configures them in ways that match the settings we had originally, minimize changes
  • runs ruff check --fix with these new settings - everything here except a single change was auto-fixed in milliseconds

For the record, my configuration is based on the one suggested here -> astral-sh/ruff#4670 (comment)

For convenience, the list of all possible isort-related configs: https://docs.astral.sh/ruff/settings/#lint_isort_lines-after-imports.

Note that now that this is so fast and --fix works very well, it'd be easy to reconsider some configs if we wanted, for example setting lines-after-imports = 2 instead of -1 could be nice.

@mistercrunch mistercrunch requested review from villebro, rusackas and a team as code owners April 29, 2024 17:45
@github-actions github-actions bot added i18n Namespace | Anything related to localization risk:db-migration PRs that require a DB migration api Related to the REST API labels Apr 29, 2024
@github-actions github-actions bot added preset-io and removed i18n Namespace | Anything related to localization api Related to the REST API labels Apr 29, 2024
@mistercrunch mistercrunch reopened this Apr 29, 2024
@mistercrunch mistercrunch merged commit 3ac387b into master May 1, 2024
28 checks passed
jzhao62 pushed a commit to jzhao62/superset that referenced this pull request May 16, 2024
@rusackas rusackas deleted the isort branch September 27, 2024 21:04
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset-io risk:db-migration PRs that require a DB migration size/L 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants