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

refactor: add pre-commit hook pyupgrade, and run it #586

Merged

Conversation

consideRatio
Copy link
Member

@consideRatio consideRatio commented Mar 14, 2022

I think this hook is great. We have not run into troubles by using it in the JupyterHub org so far.

For example, all the changes by pyupgrade have always been logically equivalent it seems. If they hadn't been that, it would been a big problem as then it wasn't just formatting etc but actual changes to the code that mattered.

The changes in this PR are:

  1. No longer passing "r" as an argument to open explicitly
  2. Use of f-strings over %s formatted strings or .format() formatted strings.
  3. class MockObject(object): became class MockObject:

Related

@consideRatio consideRatio force-pushed the pr/pre-commit-add-pyupgrade-and-run branch from a35ed81 to 170bb28 Compare March 15, 2022 19:21
@consideRatio consideRatio merged commit 5532e60 into jupyterhub:main Mar 15, 2022
@consideRatio
Copy link
Member Author

I re-reviewed the changes made by the pre-commit hook: pyupgrade which overall seems to be accepted by us in the JupyterHub team at this point and wen't for a merge. In a way, it is me reviewing the pyupgrade code as it if was a contributor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant