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 pre-commit config #6341

Merged
merged 10 commits into from
Nov 19, 2021
Merged

add pre-commit config #6341

merged 10 commits into from
Nov 19, 2021

Conversation

JelleZijlstra
Copy link
Member

Fixes #5552.

Also upgrade Black and isort while I'm at it.

Added some random formatting changes in various files to make sure pre-commit fixes it.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra
Copy link
Member Author

I guess this makes it also run black on the tests and scripts directories. That seems like a good thing to me, but I can figure out how to turn it off if that's preferred.

tests/stubtest_third_party.py Outdated Show resolved Hide resolved
tests/stubtest_third_party.py Outdated Show resolved Hide resolved
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/psf/black
rev: 21.11b1
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to have a comment about how this version must match requirements-tests-py3.txt, ideally in both places. Same for isort.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, done

@Akuli Akuli mentioned this pull request Nov 19, 2021
@Akuli Akuli merged commit 1f1bc6f into python:master Nov 19, 2021
@JelleZijlstra JelleZijlstra deleted the precommit branch November 19, 2021 14:49
@ewjoachim
Copy link
Contributor

Hey @JelleZijlstra 👋
Now that this is merged, can you clarify the state of the pre-commit script (https://github.com/python/typeshed/blob/master/pre-commit) and the documentation (https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#preparing-the-environment) ? Is it still relevant ? Is it expected that we merge the 2 scripts locally ? Or...?

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Nov 30, 2021

Feel free to submit a PR removing the old script. typeshed doesn't really care what you do locally, pre-commit.ci will now automatically fix any formatting issues in PRs.

@Akuli
Copy link
Collaborator

Akuli commented Nov 30, 2021

As a maintainer, I have never used the local pre-commit script, and I have always considered it deprecated :)

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.

Use pre-commit.ci on PRs
4 participants