A Fast Alternative to Pylint R0801
Описание и применение
Arid – быстрый инструмент для обнаружения дублирования кода в Python, заменяющий Pylint R0801 и ускоряющий CI.
Задача
Duplicate code detection (Pylint R0801) is slow and adds unnecessary overhead when only that check is needed.
Результат
Arid is 191–250× faster than Pylint for duplicate-code detection, enabling fast local feedback and structured CI reporting without the overhead of a full linter.
Рабочий процесс
- 1. Install Ruff and Arid (e.g., via uv or pip).
- 2. Run Ruff for general linting:
ruff check . - 3. Run Arid for duplicate detection:
arid .or use the GitHub Actionsponge-b0b/[email protected]. - 4. Configure Arid to ignore comments, docstrings, imports, or function signatures if desired.
- 5. In CI, use Arid’s SARIF or JSON output for automated analysis and baseline management.
- 6. For mature codebases, record existing duplicates as baseline and enforce only new duplicates.
Доказательства
Running serially, the results were: Requests — 191.19x faster, Pydantic — 219.06x faster, Polaris — 249.68x faster
Arid is a Python duplicate-code checker written in Rust
- Дата записи: 2026-09-02T14:27:40.293Z