Skip to content

add pre-commit config - #6341

Merged
Akuli merged 10 commits into
python:masterfrom
JelleZijlstra:precommit
Nov 19, 2021
Merged

Akuli merged 10 commits into
python:masterfrom
JelleZijlstra:precommit

Conversation

@JelleZijlstra

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@JelleZijlstra

Copy link
Copy Markdown
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.

Comment thread tests/stubtest_third_party.py Outdated
Comment thread tests/stubtest_third_party.py Outdated
Comment thread .pre-commit-config.yaml Outdated
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/psf/black
rev: 21.11b1

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

hauntsaninja commented Nov 30, 2021

Copy link
Copy Markdown
Collaborator

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

Akuli commented Nov 30, 2021

Copy link
Copy Markdown
Collaborator

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