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

🎨 organize imports #3169

Merged
merged 3 commits into from
Aug 15, 2024
Merged

Conversation

ff137
Copy link
Contributor

@ff137 ff137 commented Aug 15, 2024

Now's probably as good a time as any to organize imports for the codebase!

At present, the Ruff formatter doesn't sort imports (they say it is planned): https://docs.astral.sh/ruff/formatter/#sorting-imports

But, they allow to sort imports and format with:

ruff check --select I --fix
ruff format

This is mostly identical to isort, but isort includes some additional improvements in structure.

So, I applied isort . --profile black, followed by ruff check --select I --fix and ruff format.

Tada. 🎉 One bulk change to neaten up imports across the board.

Thought this is maybe worth squeezing in before the official release. Can come later if it's just a spanner in the works.

I don't see any need to include a rule like this to the lint workflow. That can probably be added eventually when ruff supports organizing imports in one command.

Copy link

Copy link
Contributor

@jamshale jamshale left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@ff137
Copy link
Contributor Author

ff137 commented Aug 15, 2024

Been itching to contribute this for a while. I reflexively sort imports, and always have to withhold here cuz it changes too much 😄

@jamshale jamshale merged commit e1b4d67 into openwallet-foundation:main Aug 15, 2024
8 checks passed
darshilnb pushed a commit to Northern-Block/aries-cloudagent-python that referenced this pull request Sep 5, 2024
* 🎨 organize imports with `isort`

Signed-off-by: ff137 <[email protected]>

* 🎨 organize imports with `ruff check --select I --fix .`

Signed-off-by: ff137 <[email protected]>

* 🎨 ruff format

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>
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.

2 participants