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

Swap out flake8 in favor of Ruff #2438

Merged
merged 8 commits into from
Aug 31, 2023

Conversation

dbluhm
Copy link
Contributor

@dbluhm dbluhm commented Aug 21, 2023

Resolves #2400.

This PR replaces flake8 with Ruff as suggested by @ff137. I've selected a "reasonable" set of selected and ignored error codes for now. I think we should add/no longer ignore more in the future.

One in particular that I think should have it's own issue raised over is C901 or cyclomatic complexity checks. By default, Ruff sets the threshold at 10. This is a pretty common threshold. There are 81 instances of ACA-Py exceeding that threshold. These are ignored for the time being as it's likely each instance will require individual attention.

I've also moved miscellaneous configuration for dev tools out of setup.cfg and translated them into pyproject.toml. We'll need to make sure this meshes well with changes in #2436.

@dbluhm dbluhm marked this pull request as draft August 21, 2023 23:04
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
@dbluhm dbluhm marked this pull request as ready for review August 30, 2023 16:32
@sonarcloud
Copy link

sonarcloud bot commented Aug 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@dbluhm
Copy link
Contributor Author

dbluhm commented Aug 30, 2023

There are a lot of changed files in this PR. Most are auto fixes from ruff. The auto fixes are all contained in 4f02300. I recommend looking at the other commits individually to see changes I actually made by hand (which is where the issues are likely to be if there are any).

@dbluhm
Copy link
Contributor Author

dbluhm commented Aug 30, 2023

This is now ready for review. @swcurran @usingtechnology. Also @Gavinok since you recently worked with the pyproject.toml and dependencies, a check from you would be good, too.

Copy link
Contributor

@usingtechnology usingtechnology 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!
I am adding a follow up ticket to update the devcontainer documentation and sample tasks to use ruff. I don't think we need it in the PR and it will be quicker for me to take it on (not much effort really).

@swcurran swcurran merged commit fa28560 into openwallet-foundation:main Aug 31, 2023
8 checks passed
@dbluhm dbluhm deleted the feature/ruff branch January 30, 2024 21:32
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.

Replace flake8 / pytest-flake8 with ruff / pytest-ruff
3 participants