-
Notifications
You must be signed in to change notification settings - Fork 23
Streamlines Ruff configuration, adds pre-commit.ci, and applies linting/formatting fixes #269
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
=======================================
Coverage 14.36% 14.36%
=======================================
Files 111 111
Lines 18020 18024 +4
Branches 3070 3070
=======================================
+ Hits 2589 2590 +1
- Misses 15194 15197 +3
Partials 237 237 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I am fine with the changes in general. One question I have is what the default number of characters per line should be? Currently it's set at 180, but if we're going to be reformatting a bunch of existing code, should we shrink this back down to 120 or 80 to be PEP 8 compliant or leave it longer and let people use line wrapping or scrolling in their preferred text editor to deal with longer lines? More vertically oriented code is easier to stack side by side and to navigate through in command line text editors like vim, but it does sometimes result in some weird formatting choices by the linter. Thoughts? |
Thanks for raising this. I agree it'd be good to discuss. The 180 comes from the Ruff configuration in the pyproject.toml (which doesn't seem to have been enforced previously, but was there already). 120 is a pretty common default for a lot of text editors, but a lot of (maybe most) Python projects that I'm aware of stick with the default of 88 from Ruff/Black so slightly above PEP8's 79. I've also seen 100 and 120, but less frequently and rarely over that. I think my preference would be to move to the Ruff default, but I'd like to hear other's thoughts on this as well though (especially if folks have strong opinions). |
Closes #268
This PR moves all Ruff configuration to
pyproject.toml, adds pre-commit.ci (to make linting/formatting more visible in CI and streamlined w/ pre-commit), and applies a bunch of linting and formatting fixes.I suspect we'll also want to remove the Ruff checks from the testing workflow in CI, but left those for now mostly for reference while we norm on configuration options (currently this varies between CI and the other configs).
Setting this as "draft" until we can find a convenient time to discuss. I know there's some other stuff pending at the moment and this will create a bunch of conflicts. Will be nice to address though and should help moving forward.