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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+15-20Lines changed: 15 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,9 @@ into the following categories:
35
35
-[Installation](#installation)
36
36
-[Code development](#code-development)
37
37
-[Codebase structure](#codebase-structure)
38
-
-[Formatting Code](#formatting-code)
39
-
-[Formatting without pre-commit](#formatting-without-pre-commit)
40
-
-[Formatting with pre-commit](#formatting-with-pre-commit)
38
+
-[Checking Code Style](#checking-code-style)
39
+
-[Formatting the code](#formatting-the-code)
40
+
-[Formatting the code with a pre-commit hook](#formatting-the-code-with-a-pre-commit-hook)
41
41
-[Run tests](#run-tests)
42
42
-[Run distributed tests only on CPU](#run-distributed-tests-only-on-cpu)
43
43
-[Run Mypy checks](#run-mypy-checks)
@@ -138,44 +138,39 @@ If you modify the code, you will most probably also need to code some tests to e
138
138
New code should be compatible with Python 3.X versions. Once you finish implementing a feature or bugfix and tests,
139
139
please run lint checking and tests:
140
140
141
-
#### Formatting Code
141
+
#### Checking Code Style
142
142
143
-
To ensure the codebase complies with a style guide, we use [flake8](https://flake8.pycqa.org/en/latest/)
144
-
and [ufmt](https://ufmt.omnilib.dev/) ([black](https://black.readthedocs.io/en/stable/) and
145
-
[usort](https://usort.readthedocs.io/en/stable/)) to format and check codebase for compliance with PEP8.
143
+
To ensure the codebase complies with the PEP8 style guide, we use [ruff](https://docs.astral.sh/ruff/)
144
+
and [black](https://black.readthedocs.io/en/stable/) to lint and format the codebase respectively.
146
145
147
-
##### Formatting without pre-commit
146
+
##### Formatting the code
148
147
149
-
If you choose not to use pre-commit, you can take advantage of IDE extensions configured to black format or invoke
150
-
black manually to format files and commit them.
151
-
152
-
To install `flake8`, `ufmt` and `mypy`, please run
148
+
To automate the process, we have configured the repo with [pre-commit](https://pre-commit.com/).
153
149
154
150
To format files and commit changes:
155
151
156
152
```bash
157
-
# This should autoformat the files
153
+
# This should lint and autoformat the files
158
154
pre-commit -a
159
155
# If everything is OK, then commit
160
156
git add .
161
157
git commit -m "Added awesome feature"
162
158
```
163
159
164
-
##### Formatting with pre-commit
160
+
##### Formatting the code with a pre-commit hook
165
161
166
-
To automate the process, we have configured the repo with [pre-commit hooks](https://pre-commit.com/) to use µfmt to autoformat the staged files to ensure every commit complies with a style guide. This requires some setup, which is described below:
162
+
To enable the `pre-commit` hooks follow the steps described below:
167
163
168
-
1. Install pre-commit in your python environment.
169
-
2. Run pre-commit install that configures a virtual environment to invoke ufmt and flake8 on commits.
164
+
1. Run `pre-commit install` to configures a virtual environment to invoke linters and formatters on commits.
170
165
171
166
```bash
172
167
pip install pre-commit
173
168
pre-commit install
174
169
```
175
170
176
-
3. When files are committed:
177
-
- If the stages files are not compliant with black or µsort, µfmt will autoformat the staged files. If this were to happen, files should be staged and committed again. See example code below.
178
-
- If the staged files are not compliant with flake8, errors will be raised. These errors should be fixed and the files should be committed again. See example code below.
171
+
2. When files are committed:
172
+
- If the stages files are not compliant, the tools autoformat the staged files. If this were to happen, files should be staged and committed again. See example code below.
173
+
- If the staged files are not compliant errors will be raised. These errors should be fixed and the files should be committed again. See example code below.
0 commit comments