Python linters
Ruff
- Ruff
- Docs
- Included in LazyVim python lang extra
- Container image i.e.:
registry.gitlab.com/pipeline-components/ruff:latest
- pre-commit hook
Issues
Usage
Ignore rules: Error suppression, i.e.:
# Ignore E741 and F841.
i = 1 # noqa: E741, F841
# Ignore _all_ violations.
x = 1 # noqa
Pyright
- Included in LazyVim python lang extra,
but can be easily replaced with
basedpyright
Basedpyright
pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server
File-level Type Controls: Globally ignore for whole file (insert at the top of file), i.e.:
# pyright: reportAny=false,reportUnknownVariableType=false,reportUnknownMemberType=false
Line-level Diagnostic Suppression:
updated_rules.append(rule) # pyright: ignore[reportUnknownArgumentType]