File: python_linting.md

package info (click to toggle)
rocm-docs-core 1.23.0-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,632 kB
  • sloc: python: 1,960; sh: 160; javascript: 152; cpp: 29; makefile: 27
file content (26 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
myst:
    html_meta:
        "description": "Tools used for checking correctness in Python code"
        "keywords": "Python linting tool, Error checker, Documentation configuration"
---

# Python Linting

The following list of tools is used for checking correctness in Python code.
These tools are set up to run as [git pre-commit hooks](https://pre-commit.com/)
via [pre-commit](https://github.com/pre-commit/pre-commit).

- [`Ruff`](https://github.com/astral-sh/ruff) for linting
  - [Usage](https://github.com/astral-sh/ruff#usage)
- [`Mypy`](https://github.com/python/mypy) for static type checking
  - [Usage](https://github.com/python/mypy#quick-start)
- [`Black`](https://github.com/psf/black) for code formatting
  - [Usage](https://github.com/psf/black#usage)
- [`isort`](https://github.com/PyCQA/isort) for import sorting
  - [Usage](https://github.com/PyCQA/isort#using-isort)

Some non-Python-specific hooks are also enabled:

- Check `yaml`, `toml`, and `json` validity
- Check for no trailing whitespaces and additional newline at the end of files