@@ -24,14 +24,23 @@ it takes a bit longer. For more details, read below.
24
24
25
25
## Preparing the environment
26
26
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!
31
28
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/ ) .
35
44
36
45
### Linux/Mac OS
37
46
@@ -74,6 +83,19 @@ following commands from a Windows terminal:
74
83
(.venv3) > python -m pip install -r requirements-tests-py3.txt
75
84
```
76
85
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
+
77
99
## Where to make changes
78
100
79
101
### Standard library stubs
0 commit comments