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

Add automatic code formatting to Requests #6095

Merged
merged 9 commits into from Apr 29, 2022
Merged

Conversation

nateprewitt
Copy link
Member

@nateprewitt nateprewitt commented Mar 23, 2022

Overview

This is a draft PR for adding standardized code formatting to Requests. Now that we intend to drop Python 2 support, we have the opportunity to clean up multiple conflicting code styles that have crept into Requests over the years.

This PR will introduce a few standard changes:

  • Integration of black for code formatting, bringing Requests in-line with what has largely become the standard.
  • Integration of isort to ensure our imports are automatically grouped and cleaned.
  • Integration of pyupgrade which will automatically pull most of the code base to Python 3.7 syntax.
  • Addition of a .pre-commit-config.yaml to orchestrate the above tools.

TODO

@verhovsky
Copy link
Contributor

https://github.com/psf/requests/blob/main/docs/dev/contributing.rst#kenneth-reitzs-code-style is no longer necessary if you're formatting the code

@nateprewitt nateprewitt added this to the 2.28.0 milestone Apr 7, 2022
@nateprewitt nateprewitt marked this pull request as ready for review April 29, 2022 18:55
Copy link
Member

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@nateprewitt nateprewitt changed the title [Draft] Add automatic code formatting to Requests Add automatic code formatting to Requests Apr 29, 2022
@sethmlarson sethmlarson merged commit 2a6f290 into psf:main Apr 29, 2022
@nateprewitt nateprewitt deleted the formatting branch April 29, 2022 19:17
This was referenced Jun 8, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants