-
Notifications
You must be signed in to change notification settings - Fork 124
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
Freshen up support tooling. #222
base: master
Are you sure you want to change the base?
Conversation
6b45d11
to
267b8f9
Compare
So to come back from what I said on Twitter:
What is your opinion on isort, black, mypy and pre-commit ? I can probably add all of those in on this pull request. |
I think these changes are looking good to me. It would be nice to break things up a bit. For example, adding all the SPDX, switching to six, etc. in different PRs. So far I didn't see anything concerning, but if there was an issue, at least we could chat about it independently. I'm definitely a fan of black and started using it here a while back, that said, I don't think I automated the process and had been simply relying on my editor to do the needful. I'm also a fan of mypy, but again, just haven't had a chance to use it. Using isort also seems nice, although I'm a little concerned I could get annoyed with it if it doesn't work well all the time. Coming from Go, not having to reorder imports is definitely nice. As for pre-commit, I'm a little more hesitant. I'm not a huge fan of magic automation and that feels a little magical to me. I'll be honest though and mention I'm saying this from ignorance so I'm happy to give it a try and learn something new! In any case, if you want to submit PRs to use this stuff, let's do it individually so it is easier to understand and chat about. Thanks! |
SG! Splitting up those that don't have obvious dependencies between each other. The pre-commit "magic" is not really more magic than integrating with the editor — it basically just makes sure that black/isort are run before you complete the commit, but we can discuss that on the dedicated pull request. I'll try to send them as independently as I can. |
Sent a few changes through already, I would prefer getting those merged before I rebase the black/isort parts because there'd be a lot of conflicts on both otherwise :( |
This makes it easier to figure out _why_ something fails to look up altogether.
When caching permanent redirects, if `body` is left to `None`, there's an infinite recursion that will lead to the caching to silently fail and not cache anything at all. So instead, make `body` a required parameter, which can be empty (`''`) for cached redirects.
This is to workaround an isort bug that appears fixed in master, where the Transfer-Encoding: chunked line is interpreted as an encoding for the file.
This includes isort, black and some basic hygiene on text files.
This is a fairly common unix extension for backup files used at least by Emacsen and vim.
This makes it easier to use constants for status codes as well.
This is just a matter of cleanup, I can't think of any good reason for this _not_ to be marked abstract.
This is a bit more nuanced in Python 3, where only EEXIST errors are suppressed, to match the `delete` codepath.
- id: isort | ||
additional_dependencies: | ||
- toml | ||
- repo: https://github.com/python/black |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codespell and ruff
This includes a couple of fixes for 308 redirects, some extra debug logging, and a whole lot of tooling changes to use isort, black and pre-commit.