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
1) Make a fork of the repository on the GitHub (see [here](https://github.com/firstcontributions/first-contributions#fork-this-repository) for details).
84
-
As a result, for example your username is `happy-ignite-developer`, then you should be able to see your fork on the GitHub, e.g https://github.com/happy-ignite-developer/ignite.git
83
+
1. Make a fork of the repository on the GitHub (see [here](https://github.com/firstcontributions/first-contributions#fork-this-repository) for details).
84
+
As a result, for example your username is `happy-ignite-developer`, then you should be able to see your fork on the GitHub, e.g https://github.com/happy-ignite-developer/ignite.git
85
85
86
-
2) Clone your fork locally and setup `upstream`. Assuming your username is `happy-ignite-developer`:
86
+
2. Clone your fork locally and setup `upstream`. Assuming your username is `happy-ignite-developer`:
@@ -136,48 +138,39 @@ If you modify the code, you will most probably also need to code some tests to e
136
138
New code should be compatible with Python 3.X versions. Once you finish implementing a feature or bugfix and tests,
137
139
please run lint checking and tests:
138
140
139
-
#### Formatting Code
141
+
#### Checking Code Style
140
142
141
-
To ensure the codebase complies with a style guide, we use [flake8](https://flake8.pycqa.org/en/latest/)
142
-
and [ufmt](https://ufmt.omnilib.dev/) ([black](https://black.readthedocs.io/en/stable/) and
143
-
[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.
144
145
145
-
##### Formatting without pre-commit
146
+
##### Formatting the code
146
147
147
-
If you choose not to use pre-commit, you can take advantage of IDE extensions configured to black format or invoke
148
-
black manually to format files and commit them.
149
-
150
-
To install `flake8`, `ufmt` and `mypy`, please run
151
-
152
-
```bash
153
-
bash ./tests/run_code_style.sh install
154
-
```
148
+
To automate the process, we have configured the repo with [pre-commit](https://pre-commit.com/).
155
149
156
150
To format files and commit changes:
157
151
158
152
```bash
159
-
# This should autoformat the files
160
-
bash ./tests/run_code_style.sh fmt
153
+
# This should lint and autoformat the files
154
+
pre-commit -a
161
155
# If everything is OK, then commit
162
156
git add .
163
157
git commit -m "Added awesome feature"
164
158
```
165
159
166
-
##### Formatting with pre-commit
160
+
##### Formatting the code with a pre-commit hook
167
161
168
-
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:
169
163
170
-
1. Install pre-commit in your python environment.
171
-
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.
172
165
173
166
```bash
174
167
pip install pre-commit
175
168
pre-commit install
176
169
```
177
170
178
-
3. When files are committed:
179
-
- 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.
180
-
- 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