Skip to content

Commit 8554985

Browse files
authored
update coding style docs (#462)
1 parent 88b7104 commit 8554985

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

doc/contribute.rst

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,24 @@ If you are comfortable fixing the issue, please do so and submit a pull request.
1010

1111
Coding style
1212
------------
13-
We use `black <https://github.com/psf/black>`_ for formatting.
14-
Please install it following its documentation, and run it with the command line argument ``-l 120``, for example at the project root directory:
13+
We use `ruff <https://github.com/astral-sh/ruff>`_ and `pre-commit <https://github.com/pre-commit/pre-commit/>`_ for linting and formatting.
14+
Please find the instructions in `this page <https://mdolab-mach-aero.readthedocs-hosted.com/en/latest/machFramework/contribute.html#coding-style>`_.
1515

16-
.. prompt:: bash
16+
Additionally, we use `isort <https://github.com/PyCQA/isort>`_ for import sorting.
17+
Please install it by
1718

18-
black . -l 120
19+
.. prompt:: bash
1920

20-
This will automatically format all Python files.
21+
pip install isort
2122

22-
We use `flake8 <https://flake8.pycqa.org/en/latest/>`_ for linting.
23-
Please install it following its instructions, and run it at the project root with:
23+
and fix the sorting of all files by running:
2424

2525
.. prompt:: bash
2626

27-
flake8 .
28-
29-
The configuration file we use for flake8 is a combination of `this file <https://github.com/mdolab/.github/blob/master/.flake8>`__ and the one at the root of this repository.
30-
If there are any PEP-8 violations, ``flake8`` will print out the nature of the violation.
31-
We run continuous integration with these tools on all pull requests submitted.
32-
For an easier workflow, we recommend integrating these tools with your code editor.
27+
isort .
3328

3429
.. warning::
35-
For a PR to be accepted, it must pass all GitHub checks, which include both formatting checks with ``black`` and syntax checks with ``flake8``.
30+
For a PR to be accepted, it must pass all GitHub checks, which include formatting and syntax checks with ``ruff`` and ``pre-commit`` and import sorting checks with ``isort``.
3631

3732
Documentation
3833
-------------

0 commit comments

Comments
 (0)