Skip to content

Commit 3aa444b

Browse files
author
Joachim Jablon
authored
Remove deprecated pre-commit script (#6455)
1 parent f2a7d66 commit 3aa444b

File tree

2 files changed

+29
-35
lines changed

2 files changed

+29
-35
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,23 @@ it takes a bit longer. For more details, read below.
2424

2525
## Preparing the environment
2626

27-
To reformat the code, check for common problems, and
28-
run the tests, it can be useful to prepare a
29-
[virtual environment](https://docs.python.org/3/tutorial/venv.html) and install
30-
certain libraries typeshed uses to check stub files.
27+
### Code away!
3128

32-
Follow platform-specific instructions below. Following that, to automatically
33-
check your code before committing, you can copy the file `pre-commit` to
34-
`.git/hooks/pre-commit`.
29+
Typeshed runs continuous integration (CI) on all pull requests. This will
30+
automatically fix formatting (using `black`, `isort`) and run tests.
31+
It means you can ignore all local setup on your side, focus on the
32+
code and rely on the CI to fix everything, or point you to the places that
33+
need fixing.
34+
35+
### ... Or create a local development environment
36+
37+
If you prefer to run the tests & formatting locally, it's
38+
possible too. Follow platform-specific instructions below.
39+
40+
Whichever platform you're using, you will need a
41+
virtual environment. If you're not familiar with what it is and how it works,
42+
please refer to this
43+
[documentation](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).
3544

3645
### Linux/Mac OS
3746

@@ -74,6 +83,19 @@ following commands from a Windows terminal:
7483
(.venv3) > python -m pip install -r requirements-tests-py3.txt
7584
```
7685

86+
## Code formatting
87+
88+
The code is formatted by `black` and `isort`.
89+
90+
The repository is equipped with a [`pre-commit.ci`](https://pre-commit.ci/)
91+
configuration file. This means that you don't *need* to do anything yourself to
92+
run the code formatters. When you push a commit, a bot will run those for you
93+
right away and add a commit to your PR. Neat, no?
94+
95+
That being said, if you *want* to run the checks locally when you commit, you
96+
can install the hooks: please refer to the [pre-commit](https://pre-commit.com/)
97+
documentation.
98+
7799
## Where to make changes
78100

79101
### Standard library stubs

pre-commit

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)