-
Notifications
You must be signed in to change notification settings - Fork 36
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
Integrate isort
#385
Integrate isort
#385
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @RomiPolaczek ✋
Great work!
Approving with one question inline
(making sure that the precommit step both checks and applies fixes)
@@ -25,3 +25,7 @@ repos: | |||
args: | |||
- --remove-empty-cells | |||
- --preserve-cell-outputs | |||
- repo: https://github.com/pycqa/isort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this step checks and applies fixes if necessary, right?
Is the order important? meaning if black should run before or after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mosheraboh,
Thank you for the feedback! 🙌
Yes, the pre-commit step for isort
both checks and applies fixes as necessary to ensure imports are properly sorted.
As for the order: It's generally recommended that isort
runs before black, as isort
organizes imports and black
formats the entire file. This avoids potential conflicts where black
might undo some of isort
's changes.
I’ve now pushed a commit that updates the order in .pre-commit-config.yaml
to ensure isort
runs before black
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks again.
Goal
Arrange Fuse's code base, and particular the imports in each file.
Related issue: #214
Key files:
.pre-commit-config.yaml
: Addisort
as a pre-commit hook to enforce consistent import order./.github/workflows/lint.yaml
: Addedisort
into Github actions for automated linting during CI.setup.cfg
: Configuredisort
to use theblack
profile, ensuring alignment between import sorting and code formatting standards.