Add ruff (linter + formatter) to enforce consistent code style across the repository.
What to do
- Add
ruff-check and ruff-format hooks to .pre-commit-config.yaml
- Add
[tool.ruff] configuration to pyproject.toml with:
target-version = 'py39'
quote-style = 'single' (single quotes for strings, """ for triple-quoted)
- Lint rules:
E, W, F, I, B, C4, UP, SIM, RUF
- Apply
ruff format to all Python files
- Fix any
ruff check violations
Reference
See monitoring-plugins/pyproject.toml and firewallfabrik/pyproject.toml for the configuration pattern.
Add ruff (linter + formatter) to enforce consistent code style across the repository.
What to do
ruff-checkandruff-formathooks to.pre-commit-config.yaml[tool.ruff]configuration topyproject.tomlwith:target-version = 'py39'quote-style = 'single'(single quotes for strings,"""for triple-quoted)E,W,F,I,B,C4,UP,SIM,RUFruff formatto all Python filesruff checkviolationsReference
See
monitoring-plugins/pyproject.tomlandfirewallfabrik/pyproject.tomlfor the configuration pattern.