You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Create a new branch to hold your development changes:
41
41
42
-
```bash
43
-
git checkout -b a-descriptive-name-for-my-changes
44
-
```
42
+
```bash
43
+
git checkout -b a-descriptive-name-for-my-changes
44
+
```
45
45
46
-
**do not** work on the `main` branch.
46
+
**do not** work on the `main` branch.
47
47
48
48
4. Set up a development environment by running the following commandin a virtual environment:
49
49
50
-
```bash
51
-
pip install -e ".[dev]"
52
-
```
50
+
```bash
51
+
pip install -e ".[dev]"
52
+
```
53
53
54
54
(If datasets was already installed in the virtual environment, remove
55
55
it with `pip uninstall datasets` before reinstalling it in editable
56
56
mode with the `-e` flag.)
57
57
58
58
5. Develop the features on your branch.
59
59
60
-
6. Format your code. Run black and ruff so that your newly added files look nice with the following command:
60
+
6. Format your code. Run `black` and `ruff` so that your newly added files look nice with the following command:
61
+
62
+
```bash
63
+
make style
64
+
```
65
+
66
+
7. _(Optional)_ You can also use [`pre-commit`](https://pre-commit.com/) to format your code automatically each time run `git commit`, instead of running `make style` manually.
67
+
To do this, install `pre-commit` via `pip install pre-commit` and then run `pre-commit install`in the project's root directory to set up the hooks.
68
+
Note that if any files were formatted by `pre-commit` hooks during committing, you have to run `git commit` again .
61
69
62
-
```bash
63
-
make style
64
-
```
65
70
66
-
7. Once you're happy with your contribution, add your changed files and make a commit to record your changes locally:
71
+
8. Once you're happy with your contribution, add your changed files and make a commit to record your changes locally:
67
72
68
-
```bash
69
-
git add -u
70
-
git commit
71
-
```
73
+
```bash
74
+
git add -u
75
+
git commit
76
+
```
72
77
73
-
It is a good idea to sync your copy of the code with the original
74
-
repository regularly. This way you can quickly account for changes:
78
+
It is a good idea to sync your copy of the code with the original
79
+
repository regularly. This way you can quickly account for changes:
75
80
76
-
```bash
77
-
git fetch upstream
78
-
git rebase upstream/main
81
+
```bash
82
+
git fetch upstream
83
+
git rebase upstream/main
79
84
```
80
85
81
-
8. Once you are satisfied, push the changes to your fork repo using:
86
+
9. Once you are satisfied, push the changes to your fork repo using:
0 commit comments