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

👷 fix lint workflow and 🎨 apply ruff linting #3166

Closed ff137 closed 1 month ago

ff137 commented 1 month ago

Just upgrades the ruff pre-commit hook, and applies the pre-commit run --all-files command, as introduced in #3080

edit: also fixes the lint workflow to do a formatting check

Because, when I just ran ruff format, it rekt my uncommitted work. :smile: (Now I can run format without 328 files changed)

ff137 commented 1 month ago

Confirmed that now the lint workflow (format check) fails with faulty line: https://github.com/hyperledger/aries-cloudagent-python/actions/runs/10402565667/job/28807290328?pr=3166

jamshale commented 1 month ago

Thanks! I think this formatting is cleaner. I don't think it's necessary to squeeze into v1.0.0 but will approve and merge shortly.

ff137 commented 1 month ago

Can confirm lint workflow also fails if lint rules are broken: https://github.com/hyperledger/aries-cloudagent-python/actions/runs/10407635261/job/28823337736?pr=3166

sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
76.8% Coverage on New Code (required ≥ 80%)
6.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

ff137 commented 1 month ago

It sounded like a 1.0.0 release is imminent. Is there any reason not to include format changes? 😄

jamshale commented 1 month ago

It is imminent :smile: I do think this is safe enough to include. I'm going to merge and let @swcurran decide on whether to include it in the tagged release.

PatStLouis commented 1 month ago

I'm also having linting issues with the current main branch using black, we need to make sure the tests pick this up. We had occurrences in the past where a black version upgrade introduced a significant amount of changes. This might be related to the recent black version released august 4th which bumped the version from 24.4 to 24.8.

https://pypi.org/project/black/24.8.0/

jamshale commented 1 month ago

@PatStLouis we don't have black as a formatter for acapy anymore. You should be using ruff instead.

PatStLouis commented 1 month ago

Oh that explains a lot, missed that one. I just switched and it works pretty good! Thanks for the heads up.