diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20452a64..83d136cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,3 +105,51 @@ because the copied file is an executable script (so from GIT point of view it is to enable it automatically). +### Type hints checks + +It is possible to check if type hints added into the code are correct and whether assignments, function calls etc. use values of the right type. This check is invoked by following command: + +``` +make check-types +``` + +Please note that type hints check might be very slow on the first run. +Subsequent runs are much faster thanks to the cache that Mypy uses. This check +is part of a CI job that verifies sources. + + +### Linters + +_Black_, _Ruff_, Pyright, and _Pylint_ tools are used as linters. There are a bunch of linter rules enabled for this repository. All of them are specified in `pyproject.toml`, such us in sections `[tool.ruff]` and `[tool.pylint."MESSAGES CONTROL"]`. Some specific rules can be disabled using `ignore` parameter (empty now). + +List of all _Ruff_ rules recognized by Ruff can be retrieved by: + + +``` +ruff linter +``` + +Description of all _Ruff_ rules are available on https://docs.astral.sh/ruff/rules/ + +Ruff rules can be disabled in source code (for given line or block) by using special `noqa` comment line. For example: + +```python +# noqa: E501 +``` + +List of all _Pylint_ rules can be retrieved by: + +``` +pylint --list-msgs +``` + +Description of all rules are available on https://pylint.readthedocs.io/en/latest/user_guide/checkers/features.html + +To disable _Pylint_ rule in source code, the comment line in following format can be used: + +```python +# pylint: disable=C0415 +``` + + +