@@ -28,28 +28,27 @@ Code Style
28
28
==========
29
29
30
30
The project uses `flake8 <https://flake8.pycqa.org/en/latest/ >`_ for linting,
31
- `black <https://black.readthedocs.io/en/stable/ >`_ for formatting the code,
32
- `isort <https://pycqa.github.io/isort/ >`_ for formatting and sorting imports,
31
+ `ruff <https://docs.astral.sh/ruff/ >`_ for formatting the code and sorting imports,
33
32
and `pre-commit <https://pre-commit.com/ >`_ for checking/fixing commits for
34
33
correctness before they are made.
35
34
36
35
You will need to install ``pre-commit `` yourself, and then ``pre-commit `` will
37
- take care of installing ``flake8 ``, `` black `` and ``isort ``.
36
+ take care of installing ``flake8 `` and ``ruff ``.
38
37
39
38
After cloning your repository, go into it and run::
40
39
41
40
pre-commit install
42
41
43
42
to install the hooks. On the next commit that you make, ``pre-commit `` will
44
43
download and install the necessary hooks (a one off task). If anything in the
45
- commit would fail the hooks, the commit will be abandoned. For ``black `` and
46
- `` isort ``, any necessary changes will be made automatically, but not staged.
44
+ commit would fail the hooks, the commit will be abandoned. For ``ruff ``, any
45
+ necessary changes will be made automatically, but not staged.
47
46
Review the changes, and then re-stage and commit again.
48
47
49
48
Using ``pre-commit `` ensures that code that would fail in QA does not make it
50
49
into a commit in the first place, and will save you time in the long run. You
51
50
can also (largely) stop worrying about code style, although you should always
52
- check how the code looks after ``black `` has formatted it, and think if there
51
+ check how the code looks after ``ruff `` has formatted it, and think if there
53
52
is a better way to structure the code so that it is more readable.
54
53
55
54
Documentation
0 commit comments