Skip to content

Commit 4ba954d

Browse files
schroedtertchraibi
andauthored
Use ruff as linter and formatter (#337)
Use ruff as linter and formatter --------- Co-authored-by: Mohcine Chraibi <m.chraibi@fz-juelich.de>
1 parent 302d071 commit 4ba954d

30 files changed

Lines changed: 1027 additions & 1293 deletions

.pylintrc

Lines changed: 0 additions & 564 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55

66
-----------------
77
[![PyPI Latest Release](https://img.shields.io/pypi/v/pedpy.svg)](https://pypi.org/project/pedpy/)
8-
[![Nightly Release](https://img.shields.io/badge/nightly-install-9cf)](https://test.pypi.org/project/PedPy/)
98
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pedpy)
109
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7194992.svg)](https://doi.org/10.5281/zenodo.7194992)
1110
[![License](https://img.shields.io/pypi/l/pedpy.svg)](https://github.com/PedestrianDynamics/pedpy/blob/main/LICENSE)
1211
![ci workflow](https://github.com/PedestrianDynamics/pedestrian-trajectory-analyzer/actions/workflows/ci.yml/badge.svg)
13-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
14-
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
12+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
1513
[![Documentation Status](https://readthedocs.org/projects/pedpy/badge/?version=latest)](http://pedpy.readthedocs.io/?badge=latest)
1614
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7046/badge)](https://bestpractices.coreinfrastructure.org/projects/7046)
1715
[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu)

docs/source/developer_guide.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,25 +256,25 @@ Except from the functional requirements (see :ref:`Tests`) for changes in the co
256256
These will also be checked in our CI process for each Pull Request.
257257

258258
1. **Code formatting:**
259-
To ensure that your Pull Request may get accepted, make sure that the code is formatted with ``black``.
259+
To ensure that your Pull Request may get accepted, make sure that the code is formatted with ``ruff format``.
260260
We provide a helper script (``scripts/format.sh``) that will format every file in the correct manner.
261261
To test it locally you can use ``scripts/check-format.sh``.
262262

263-
2. **Docstring style:**
264-
Make sure to check whether every of your new functions has a docstring.
265-
We decided to use Google-docstring style to be used in our project.
266-
You can use `pydocstyle` to check if everything is correct locally.
267-
268-
3. **Type Hints:**
263+
2. **Type Hints:**
269264
We decided that every function, parameter, return value, etc. should be annotated with type hints, as they make it clearer for users what to expect and what is needed.
270265
For ensuring that no type hint is forgotten we use ``MyPy``.
271266
This can be checked locally via ``python3 -m mypy --config-file mypy.ini pedpy/``
272267

273-
4. **Linting:**
268+
3. **Linting:**
274269
Linting in Python is an important process that helps ensure that our code is consistent and adheres to best practices.
275-
Linting tools like ``pylint`` analyze our code for potential errors, bad practices, and code smells.
270+
Linting tools like ``ruff`` analyze our code for potential errors, bad practices, and code smells.
276271
This helps us catch issues early on and prevents them from becoming bigger problems down the line.
277272

273+
4. **Docstring style:** (included in linting)
274+
Make sure to check whether every of your new functions has a docstring.
275+
We decided to use Google-docstring style to be used in our project.
276+
You can use `ruff` to check if everything is correct locally.
277+
278278
If you want to run the same tests as in the CI pipeline, you can use ``scripts/ci.sh``.
279279

280280
Update documentation

0 commit comments

Comments
 (0)