Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 2371f50

Browse files
committed
FIXUP: CONTRIBUTING.md
1 parent 1b4ef44 commit 2371f50

File tree

1 file changed

+42
-20
lines changed

1 file changed

+42
-20
lines changed

CONTRIBUTING.md

+42-20
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ Once you have installed Python 3, please open a Terminal and run:
5252
mkdir -p ~/synapse
5353
python3 -m venv ./env
5454
source ./env/bin/activate
55-
pip install -e ".[all,lint,mypy,test,black,tox]"
55+
pip install -e ".[all,lint,mypy,test]"
56+
pip install tox
5657
```
5758

5859
This will install the developer dependencies for the project.
@@ -72,7 +73,7 @@ changes into our repo.
7273
Please base your changes on the `develop` branch.
7374

7475
```sh
75-
git clone [email protected]:matrix-org/synapse.git
76+
git clone [email protected]:YOUR_GITHUB_USER_NAME/synapse.git
7677
```
7778

7879
# 4. Get in touch.
@@ -82,7 +83,8 @@ Join our developer community on Matrix: #synapse-dev:matrix.org !
8283

8384
# 5. Pick an issue.
8485

85-
Fix your favorite problem of find an issue on https://github.com/matrix-org/synapse/issues/ .
86+
Fix your favorite problem or perhaps find a [Good First Issue](https://github.com/matrix-org/synapse/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22)
87+
to work on.
8688

8789

8890
# 6. Turn coffee and documentation into code and documentation!
@@ -120,7 +122,7 @@ The linters look at your code and do two things:
120122
- ensure that your code follows the coding style adopted by the project;
121123
- catch a number of errors in your code.
122124

123-
They're very fast, don't hesitate!
125+
They're pretty fast, don't hesitate!
124126

125127
```sh
126128
source ./env/bin/activate
@@ -130,15 +132,21 @@ source ./env/bin/activate
130132
Note that the linters *will modify your files* to fix styling errors.
131133
Make sure that you have saved all your files.
132134

135+
If you wish to restrict the linters to only the files changed since the last commit
136+
(much faster!), you can instead run:
133137

134-
If you wish to restrict the linters to only run on some files, you can instead run:
138+
```sh
139+
source ./env/bin/activate
140+
./scripts-dev/lint.sh -d
141+
```
142+
143+
Or if you know exactly which files you wish to lint, you can instead run:
135144

136145
```sh
137146
source ./env/bin/activate
138147
./scripts-dev/lint.sh path/to/file1.py path/to/file2.py path/to/folder
139148
```
140149

141-
142150
## Run the unit tests.
143151

144152
The unit tests run parts of Synapse, including your changes, to see if anything
@@ -150,11 +158,11 @@ python -m twisted.trial tests
150158
```
151159

152160
If you wish to only run *some* unit tests, you may specify
153-
another module instead of `tests`:
161+
another module instead of `tests` - or a test class or a method:
154162

155163
```sh
156164
source ./env/bin/activate
157-
python -m twisted.trial tests.rest.admin.test_room
165+
python -m twisted.trial tests.rest.admin.test_room tests.handlers.test_admin.ExfiltrateData.test_invite
158166
```
159167

160168
If your tests fail, you may wish to look at the logs:
@@ -165,23 +173,35 @@ less _trial_temp/test.log
165173

166174
## Run the integration tests.
167175

168-
The integration tests run the full Synapse, including your changes, to
176+
The integration tests run a full Synapse, including your changes, to
169177
see if anything was broken. They are slower than the unit tests but will
170178
typically catch more errors.
171179

180+
To run the entire test suite using Sqlite3, use the following command:
172181

173-
The following will run the test suite using postgres. You will need [Docker](https://docs.docker.com/get-docker/) installed.
182+
```sh
183+
source ./env/bin/activate
184+
tox -e py36
185+
```
186+
187+
If you wish to only run *some* integration tests, you may
188+
similarly specify a module, e.g.:
174189

175190
```sh
176-
./test_postgresql.sh
191+
source ./env/bin/activate
192+
tox -e py36 -- test.rest.admin.test_room
177193
```
178194

179-
Or, if you prefer running the same tests without postgres or Docker, use this command.
195+
196+
197+
Or, to run the test suite using postgres, use the following command. You will need [Docker](https://docs.docker.com/get-docker/) installed.
180198

181199
```sh
182-
tox -e py36
200+
source ./env/bin/activate
201+
./test_postgresql.sh
183202
```
184203

204+
185205
# 8. Submit your patch.
186206

187207
Once you're happy with your patch, it's time to prepare a Pull Request.
@@ -191,8 +211,12 @@ To prepare a Pull Request, please:
191211
1. verify that [all the tests pass](#test-test-test), including the coding style;
192212
2. add a [changelog entry](#changelog);
193213
3. [sign off](#sign-off) your contribution;
194-
4. on Github, [create the Pull Request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request);
195-
5. on Github, request review from `matrix.org / Synapse Core`.
214+
4. Push code to commits to your fork of Synapse:
215+
```sh
216+
git push origin develop
217+
```
218+
5. on Github, [create the Pull Request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request);
219+
6. on Github, request review from `matrix.org / Synapse Core`.
196220

197221
## Changelog
198222

@@ -355,13 +379,11 @@ From this point, you should:
355379
1. Look at the results of the CI pipeline.
356380
- If there is any error, fix the error.
357381
2. If a developer has requested changes, make these changes.
358-
3. Create a new patch with the changes.
359-
- Please do NOT overwrite the history. New patches make the reviewer's life easier.
360-
- Push this patch to your Pull Request.
382+
3. Create a new commit with the changes.
383+
- Please [do NOT overwrite the history](docs/dev/git.md#on-keeping-the-commit-history-clean). New commits make the reviewer's life easier.
384+
- Push this commits to your Pull Request.
361385
4. Back to 1.
362386

363-
If the CI pipeline detects errors, please fix them. If the developers suggest change, please fix them, too.
364-
365387
Once both the CI and the developers are happy, the patch will be merged into Synapse and released shortly!
366388

367389
# 10. Find a new issue.

0 commit comments

Comments
 (0)