hyperledger / aries-cloudagent-python

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
405 stars 510 forks source link

:art: organize imports #3169

Closed ff137 closed 1 month ago

ff137 commented 1 month ago

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. :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.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
85.8% Coverage on New Code
1.2% Duplication on New Code

See analysis details on SonarCloud

ff137 commented 1 month ago

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